Forum

CS506 Quiz 2 Soluti...
 
Notifications
Clear all

[Solved] CS506 Quiz 2 Solution


admin
Posts: 978
Admin
Topic starter
(@shahzain)
Member
Joined: 2 years ago

 

1) Which of the following is the correct syntax to make a personal info class into a Serializable class

  1. Public class Personal Info imports Serializable {/* class body */}
  2. Public class Personal Info extends Serializable {/* class body /*}
  3. Public class Personal Info implements Serializable {/* class body */}
  4. Public class Personal Info includes Serializable {/* class body */}

 

2) The ______ method returns true or false depending upon whether the next row is available (exist) or not in Result Set.

  1. Getters
  2. Next ()
  3. Close ()
  4. Close ()

 

3) Let suppose a column has index 5 in the Result Set object. Which of the following statement is used to retrieve the column values

  1. String name = rs.getlnt (5)
  2. String = rs.getStrings(4)
  3. String name = rs.getSting (5)
  4. String name = getlnt (4)

 

4) which of the following is NOT true about Paint Component () method>

  1. It is main method for painting
  2. By default, it first paints the background
  3. Tells the component border (if any) to paint
  4. It performs custom painting (drawing circle, rectangles etc.)

 

5) By implementing this interface, a class declares that it is willing to be ________ by automatic serialization machinery.

  1. Decode
  2. Checked
  3. Destroyed
  4. Read

 

6) Socket is a _____________ communicate channel between hosts.

  1. Uni-directional
  2. Bi-directional
  3. Multi-directional
  4. Tri-directional

 

7) In the context of Socket Programming, the client does NOT know about the hostname of the machine on which the server is running.

  1. False
  2. True

 

8) In the context of Java Graphics, which of the following methods we should over ride while painting

  1. Paint Border ()
  2. Paint ()
  3. Paint Component ()
  4. Paint Children ()

 

9) How many methods are there in the Serializable interface

  1. Two
  2. Zero
  3. Three
  4. One

 

10) Painting is managed by the system, so calling paint Component () directly is NOT recommended at all.

  1. False
  2. True

 

Topic Tags
Share:
Scroll to Top