Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 104 - 2617_JSSPS_C-6
P. 104

    b.  public class assignment{

                                    public static void main(String[] args){
                                         int a ==10;

                                    System.out.println(a);
                               }
                               }
                              c.  public class D3{

                                    public static void main(String[] args){
                                    int a = 5;

                                    String name = "Chirag";
                                    System.out.println(a + name);
                               }
                              d.  public class D4{

                                    public static void main(String[] args){
                                    System.out("Welcome");
                               }}
                          9.  Guess! Who am I?

                              a.  I am an object-oriented programming language developed by Sun Microsystems.
                              b.  I am an operator used to check the equality between two values.

                              c.  I am a memory location used to store a value.

                              d.  I am a reserved word that cannot be used as the name of a variable.
                              e.  I am a data type in Java, used to store character values.

                              f.  I am a text written inside a code for better understanding of the code.

                              g.  I am the statement used to display the output of a program on the terminal.

                         10.  Competency-based/Application-based questions:

                              a.   Anil wants to increase the value of the variable a by 1 and assigns the value again to
                                the variable a. Which Java operator can help him do this?
                              b.   Naveen wants to display his name on the screen. Which data type of Java can help
                                him do this?

                                SDG Activity

                         Create a program to track agricultural production and consumption, calculating
                         yearly wastage by subtracting consumption from production. The program will
                         loop through annual data and display the results.

                    102     Premium Edition-VI

| 99 100 101 102 103 104 105 106 107 108 109 |