Whats wrong with my program?
class Hw7{
public static void main (String args[]){
String s = "Hello";
int v = String s;
System.out.println(v);
}
}
This is the error thats brought up:
--------------------Configuration: <Default>--------------------
C:\Users\Stephane\Documents\JCreator Programs\Hw7.java:5: ';' expected
int v = String s;
^
C:\Users\Stephane\Documents\JCreator Programs\Hw7.java:5: not a statement
int v = String s;
^
And this is the question that I have:
Write a program that creates a variable s of type String. Start s as “Hello”. Type cast s into a variable v of type int. Observe the output. Is automatic type conversion possible in this case?