Page 71 - iprime_V2.2_class8
P. 71
2. public class assignment{
public static void main(String[] args){
int a ==10;
System.out.println(a);
}
}
3. public class D3{
public static void main(String[] args){
int a = 5;
String name = "Chirag";
System.out.println(a + name);
}
4. public class D4{
public static void main(String[] args){
System.out("Welcome");
}}
E. Application-based questions.
1. You’re building a Java program to track students’ grades, and you want to ensure the program
can handle multiple users and be easily updated. Which feature of Java will help you create a
flexible and user-friendly application?
2. Nimisha is working in Java and she wants to increase the value of variable z by 2, so
she has written z++ but she is unable to get her expected response. Help her write
the correct statement.
Computational Thinking
Higher Order Thinking Skills (HOTS) Critical Thinking
1. Nitika has written a java code, but she is getting errors. Identify what went wrong. And
rewrite the correct code.
public class fullName{
public static void main(String[] args){
string “firstName=Sonia”
string “LastName=Mittal”
System.out.println(firstName +LastName);
}
}
2. Cite the valid variable names in Java.
Computer$, 12Print, System, First Name, Emp@Dept
Program Coding 69

