Java Basics and AWT Programming

Tests fundamental Java concepts including primitive types, exception handling, and AWT/Swing GUI programming fundamentals

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following are not the methods of the scanner class object in java?

  1. Next()
  2. nextLine()
  3. nextInt()
  4. nextChar()
  5. nextLong()
Question 2 Multiple Choice (Single Answer)

Which of the following are not the Subclasses of RuntimeException?

  1. IllegalArgumentException
  2. NullPointerException
  3. IOException
  4. IndexOutOfBoundException
  5. ArithmeticException
Question 3 Multiple Choice (Single Answer)

Which of the following event types are invalid in JAVA?

  1. FocusEvent
  2. ComponentEvent
  3. AdjustmentEvent
  4. Both (2) and (3)
  5. None of these
Question 4 Multiple Choice (Single Answer)

Which of the following methods are not used by web browser to control the applet?

  1. Wait()
  2. Destroy()
  3. Dead()
  4. Both (1) and (3)
  5. Both (1) and (2)
Question 5 Multiple Choice (Single Answer)

Which of following layout managers are present in java awt?

  1. Gridlayout
  2. Flowlayout
  3. Cardlayout
  4. Both (1) and (2)
  5. All of these
Question 6 Multiple Choice (Single Answer)

Which of the following methods cannot be invoked from the instance of Frame class in AWT?

  1. setLocation(int, int)
  2. setVisible(Boolean)
  3. setSize(int, int)
  4. setDefaultCloseOperation(int)
  5. Pack()
Question 7 Multiple Choice (Single Answer)

Which of the following methods is/are not necessary to define for a class if it implement the windowListener Interface?

  1. windowMoved()
  2. windowClosing()
  3. windowIconified()
  4. windowActivated()
  5. windowDeiconified()
Question 8 Multiple Choice (Single Answer)

How many constructors are present of BorderLayout in java?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1
Question 9 Multiple Choice (Single Answer)

Which of the following methods are not defined in the Graphics Class in Java?

  1. fillRect()
  2. fillCircle()
  3. fillOval()
  4. fillArc()
  5. None of these
Question 10 Multiple Choice (Single Answer)

How many parameters are passed to the constructor of the Font class in java?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1
Question 11 Multiple Choice (Single Answer)

Color c1 = new Color(284,60,189);

Which of the following statements about the given statement is/are correct?

  1. A new color will be created.
  2. runtime Exception
  3. Parameters are not enough
  4. Compile time error : Cannot find method color
  5. Compile time error : Color is Abstract, cannot create an object.
Question 12 Multiple Choice (Single Answer)

Which of the following source object do not generate the ActionEvent?

  1. JRadioButton
  2. JCheckBox
  3. JComboBox
  4. JList
  5. JTextField
Question 13 Multiple Choice (Single Answer)

How many primitive data types are available in Java?

  1. 9
  2. 6
  3. 8
  4. 7
  5. 5
Question 14 Multiple Choice (Single Answer)

Which of the following methods are valid in Java for handling Events?

  1. mouseEnetered()
  2. keyReleased()
  3. mouseDragged()
  4. Both (1) and (2)
  5. All of these
Question 15 Multiple Choice (Single Answer)

How many constructors are there for Layout manager FlowLayout?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1