Declaring a variable and initialising it are two different things.
Declare
String s;
Initialise
s = "hello";
Declare and initialise
String s = "hello";
Type: Posts; User: Junky
Declaring a variable and initialising it are two different things.
Declare
String s;
Initialise
s = "hello";
Declare and initialise
String s = "hello";
Oops! Misread your post.
char one = '1';
char two = 't';
System.out.println(Character.isDigit(one));
System.out.println(Character.isDigit(two));
Produces the exact output I expect: true...
I can't do what?
char currentChar = ...;
No need to use objects when it isn't necessary.
That error message is self explanatory, you did not give your variable an initial value.
String s;
if(5 == 19) {
s = "hello";
}
System.out.println(s);
In the above code what do you...