Page 106 - ComputerScience_Class_11
P. 106

Let us consider a program to print the quotient of two numbers.
                  void calculate(int a, int b)
                  {
                      double q;
                      q = a/b;
                      System.out.println("quotient : "+q);
                  }

                      Note: If we take 0 in b and as we know that we cannot divide anything by 0, so a runtime error will occur.


                            Let’s Revisit

                    ♦ Java is a third-generation object-oriented programming language.

                    ♦ Low-level languages are machine-oriented and require extensive knowledge of computer hardware and its configuration.
                    ♦ Data abstraction is the property by which the essential features of a class are represented without knowing the background
                   details that how it is actually executing, i.e., non-essential units are hidden from the user.
                    ♦ Inheritance is the method which allows one class to inherit the properties (data members and member methods) of another class.
                    ♦ Polymorphism is the feature of being able to allot a dissimilar meaning so that a variable, a method or an object can have more
                   than one form.
                    ♦ Java standalone applications can run independently on an individual computer.
                    ♦ Java applets are the small Java programs that are implanted in an HTML page and execute only within any web browser.




                                                             MIND DRILL


                   Solved Questions


              A.  Tick ( ) the correct option.
                  1.  Java was officially released in ………………… .
                    a.  1991                                        b.  1995
                    c.  1997                                        d.  2020
                  2.  Which of the following types of errors occur during the execution of a successfully compiled program?
                    a.  Logical errors                              b.  Runtime errors
                    c.  Syntax errors                               d.  None of these
                  3.  Java is a programming language that uses ………………… .
                    a.  Procedure-oriented technology               b.  Object-oriented technology
                    c.  Both a and b                                d.  Machine-level programming
                  4.  Which of the following buttons is used to compile a program in BlueJ?
                    a.  Compile                                     b.  Close
                    c.  Paste                                       d.  None of these
                  5.  A grammatical error while coding leads to a ………………… .
                    a.  Logical error                               b.  Runtime error
                    c.  Syntax error                                d.  Compilation error

                Answers
                   1.  b     2.  b    3.  b     4.  a     5.  c






                  104  Touchpad Computer Science (Ver. 3.0)-XI
   101   102   103   104   105   106   107   108   109   110   111