Couple of newbie questions
I have been trying to write a program that asks a sentence and then looks if there's a even amount of characters in that. Here's what i have:
Code:
public class IsEven {
public static void isEven() {
System.out.println("Give the sentence: ");
java.util.Scanner sc = new java.util.Scanner(System.in);
String sentence = sc.next();
boolean even = ((sentence.length() % 2) == 0);
System.out.println(even);
}
}
What's wrong there?
Second i have is a problem with method that asks lower limit and upper limit and then gives a random number between them (those two numbers included).