java-8 tag

4 questions


1 answers
151 views
0
Can you sort ArrayList with a specific method of objects?

I understand that you can arrange the ArrayLists with a comparator. But if you look at all the examples that use compareTo, it seems to be a method for strings.I want to sort the ArrayList with a spec...


1 answers
86 views
0
Java enum utilization and regular expression questions.

within the enum classWhen input char comes in, use the regular expressionReturns the appropriate enum value The task of implementing a function.There are only examples of string types.It was weird, so...

2 years ago

1 answers
122 views
0
How do we determine if a particular value exists in an array?

Let's say we have an array of String[] with the following values.public static final String[] VALUES = new String[] {AB,BC,CD,AE};Given the strings, is there a good way to check if s is present in the...

2 years ago

1 answers
157 views
0
How do you generate integer type random numbers in a specific range?

You want to use Java to generate a random number of a specific range of int types.For example:You want to generate random numbers ranging from 5 to 10 with a minimum value of 5 and a maximum value of ...


© 2024 OneMinuteCode. All rights reserved.