Page 269 - IT-802_class_12
P. 269

B.  Fill in the blanks.
               1.  With the help of the ............................, Java programs are considered platform-independent and portable.
               2.  A  ............................ is the designation for a storage place in the computer’s internal memory in technical terms.

               3.  An ............................ is used for writing codes that perform arithmetical calculations.
               4.  A ............................ is used to check whether an expression results in true or false.
               5.  A ............................ loop is an entry-controlled loop.
               6.  Do not place a ............................ at the end of the test condition in a while loop.

               7.  A useful tool for effectively identifying/detecting and repairing logical flaws in a program is an ............................ .
               8.  A ............................ block surrounds the part of the code that can generate exception(s).
               9.  A ............................ program is one that can perform multiple tasks concurrently so that there is optimal utilization of the
                 computer’s resources.
              10.  The ............................ has the same name as the class.

                 Ans.  1. JVM              2. variable       3. arithmetic operator   4. logical operator    5. While
                      6. semi colon        7. assertion      8. try               9. multithreaded   10. Constructor



                                                            Section B
                                                    (Subjective Type Questions)
            A.  Short answer type questions.
               1.  Define class.
             Ans.  A class in Java is a non-primitive/user-defined data type that acts as a blueprint for creating objects of the same type.
               2.  What is an array?
             Ans.  Arrays can be defined as a set of variables that contains values of same data types having same variable name but different
                 subscripts required to separate the values. Thus, an array is a composite data type.
               3.  What are the requirement of wrapper class?
             Ans.  Wrapper class is required to:
                 Ð  Store the primitive data type in objects
                 Ð  Convert String to primitive data types and vice versa.
               4.  In how many ways threads can be created in Java?
             Ans.  In Java, threads can be created in two ways
                 Ð  By extending the Thread class
                 Ð  By implementing the Runnable interface

               5.  Write the syntax of do while statement.
             Ans.  The syntax of do while statement is given below:

                 do
                 {
                 Statements
                 }
                 while (expression);
               6.  If a=20 and b=30 What will be the value of a%=b?                            [CBSE Sample Paper 2023]
             Ans.  20
               7.  Identify the valid variable names from the following:                       [CBSE Sample Paper 2023]
                 Total marks , int , marks$ , marks4
             Ans.  marks$ , marks4 are valid variable names




                                                                               Fundamentals of Java Programming  267
   264   265   266   267   268   269   270   271   272   273   274