Page 70 - Trackpad_ipro 4.1_Class8
P. 70

7.  public class C7{
                                                                                   Write output here:
                             public static void main(String args[]){
                             int a=5;

                             int b=6;
                             System.out.println(a++ + ++a);

                             System.out.println(b++ + b++);
                         }}


                  D.  Find the errors in the following Java codes:
                      1.  public class program{
                             public static void main(String[] args){
                                 int a = 10;
                                 int b = 20
                                 int c = a + b;
                                 System.out.println("The value of c is: "+c);
                             }
                         }
                      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.



                    68     iPro (Ver. 4.1)-VIII
   65   66   67   68   69   70   71   72   73   74   75