Professional Documents
Culture Documents
Source Code:
public class Main
Output:
2. Create a variable named carName and assign the value Volvo to it.
Source code:
public class Main
String carName="Volvo";
System.out.println(carName);
}
Output:
3. Create a variable named maxSpeed and assign the value 120 to it..
Source code:
public class Main
int maxSpeed=120;
System.out.println(maxSpeed);
Output:
int x=5;
int y=10;
int sum=x+y;
System.out.println(sum);
}
Output:
String z="x+y";
System.out.println(z);
Output:
6.