Java

answering the questions need basic knowledge of methods in java

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods is/are 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 2 Multiple Choice (Single Answer)

Which of the following methods is/are not necessary to define a class, if it implements the Window Listener Interface?

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

Which of the following event types is/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 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 5 Multiple Choice (Single Answer)

Which of the following is the subclass of RuntimeException?

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

Which of the following is not a method of the scanner class object in Java?

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

How many constructors is/are present in BorderLayout in java?

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

Which of following layout managers is/are present in Java awt?

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

Which of the following statements is/are correct?

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

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

Which of the following methods is not defined in the Graphics class in Java?

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

The number of parameters passed to the constructor of the Font class in Java is

  1. 4
  2. 3
  3. 2
  4. 1
  5. None of these
Question 12 Multiple Choice (Single Answer)

Which of the following source objects does 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)

How many constructors are there for FlowLayout?

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

Which of the following methods is/are valid in Java for handling events?

  1. mouseEnetered()
  2. keyReleased()
  3. mouseDragged()
  4. both 1 and 2
  5. all of these