Page 464 - Cs_withBlue_J_C11_Flipbook
P. 464

3.  Which of the following is termed as predefined package in Java?
                    a.  Built-in                                    b.  Encapsulated
                    c.  Imported                                    d.  Program
                  4.  Which of the following is not a built-in package in Java?
                    a.  java.net                                    b.  java.scanner
                    c.  java.awt                                    d.  java.sql

                  5.  A class can have ………………… package statement.
                    a.  single                                      b.  multiple
                    c.  double                                      d.  triple
                  6.  Which of the following keywords are used to define packages in Java?
                    a.  pkg                                         b.  Pkg
                    c.  package                                     d.  Package
                  7.  Which of the following access specifiers can be used for a class so that its members can be accessed by a different class in a
                    different package?
                    a.  default                                     b.  private
                    c.  protected                                   d.  public
                  8.  Which of the following statements is used to import all the classes under package mypackage?
                    a.  import java.mypackage*                      b.  import mypackage.java.*
                    c.  import mypackage.*                          d.  import mypack
                  9.  Which of the following java packages is imported by default?
                    a.  java.io                                     b.  java.lang
                    c.  java.util                                   d.  java.net

                 10.  Which symbol is used to separate a package from its sub-package?
                    a.  $                                           b.  #
                    c.  ?                                           d.  .

                Answers
                  1.  d      2.  a    3.  a     4.  b     5.  b     6.  c     7.  d     8.  c     9.  b     10.  d

              B.  Fill in the blanks:

                  1.  The full form of JDK is ………………… .
                  2.  Math class belongs to package ………………… .

                  3.  To use the Scanner class we have to import ………………… .
                  4.  ………………… contains classes to handle applets.

                  5.  ………………… packages are developed by programmers.
                  6.  java.io is a ………………… package.
                  7.  A package contains a number of ………………… .

                  8.  ………………… keyword is used to include a package in a program.
                  9.  When we click New package from the drop-down list of Edit menu ………………… window appears.

                 10.  Package ………………… naming collision.
                Answers
                  1.  Java Development Kit  2.  java.lang    3.  java.util     4.  java.applet      5.  User-defined
                  6.   built-in        7.   classes           8.  import          9.  Create New Package   10.  eliminates



                462462  Touchpad Computer Science-XI
   459   460   461   462   463   464   465   466   467   468   469