Page 274 - IT-802_class_12
P. 274

B.  Fill in the blanks.
           1.  ............................ are used to make code more readable.
           2.  ............................  are special symbols that execute specific operations in a programming language.
           3.  The ............................ statement is used to execute a block of code matching one value out of many possible values.

           4.  An ............................  statement specifies a condition that must be true at a specific moment during the program’s execution.
           5.  A ............................ block contains the exception handler-specific code that is executed when the exception occurs.
           6.  A multithreaded program consists of two or more parts called ............................ .
           7.  The ............................ has no return type.
           8.  Do not forget the semicolon at the end of the test condition in a ............................ loop.

           9.  ............................ variables are only accessible within the methods in which they are stated.
          10.  The shortcut key to run Java programs in NetBeans is ............................ .

                                                         Section B
                                                 (Subjective Type Questions)
        A.  Short answer type questions.
           1.  What is object-oriented programming (OPP)?
           2.  What do you mean by IDE?
           3.  How do you save a program in NetBeans?
           4.  Write the syntax of switch statement.
           5.  What is wrapper class?
           6.  What is Java Bytecode?                                                             [CBSE Handbook]
           7.  Find the error and give correct code:                                       [CBSE Sample Paper 2022]
             int number = 1;
             while (number <= 5)
             {System.out.print(“Square of “ + number);
             System.out.println(“ = “ + number*number);}
           8.  Read the code carefully and give its output:                                [CBSE Sample Paper 2022]

             package javaprogarms;
             public class StringDemo{
             public static void main(String[]args)
             {
             String myString = “iNFORmATiON TECHNOLOGy”;
             System.out.println(myString.indexof(’E’));
             System.out.println(myString.contains(“NO”));

             System.out.println(myString.length(); }};
        B.  Long answer type questions.
           1.  What are comments in Java? How do you write it?
           2.  What is assignment operator? Write the names of different types of assignment operators.
           3.  Differentiate between while and do-while loop.
           4.  What is an exception? Why do you need to handle it?
           5.  Write the program to determine a student’s percentage based on the marks he or she received and the overall number of
             marks for a test.
           6.  How can threads be created in Java? Briefly explain with an example.               [CBSE Handbook]



          272   Touchpad Information Technology-XII
   269   270   271   272   273   274   275   276   277   278   279