Java Basics and AWT Programming
Tests fundamental Java concepts including primitive types, exception handling, and AWT/Swing GUI programming fundamentals
Questions
Which of the following are not the methods of the scanner class object in java?
- Next()
- nextLine()
- nextInt()
- nextChar()
- nextLong()
Which of the following are not the Subclasses of RuntimeException?
- IllegalArgumentException
- NullPointerException
- IOException
- IndexOutOfBoundException
- ArithmeticException
Which of the following event types are invalid in JAVA?
- FocusEvent
- ComponentEvent
- AdjustmentEvent
- Both (2) and (3)
- None of these
Which of the following methods are not used by web browser to control the applet?
- Wait()
- Destroy()
- Dead()
- Both (1) and (3)
- Both (1) and (2)
Which of following layout managers are present in java awt?
- Gridlayout
- Flowlayout
- Cardlayout
- Both (1) and (2)
- All of these
Which of the following methods cannot be invoked from the instance of Frame class in AWT?
- setLocation(int, int)
- setVisible(Boolean)
- setSize(int, int)
- setDefaultCloseOperation(int)
- Pack()
Which of the following methods is/are not necessary to define for a class if it implement the windowListener Interface?
- windowMoved()
- windowClosing()
- windowIconified()
- windowActivated()
- windowDeiconified()
How many constructors are present of BorderLayout in java?
- 5
- 4
- 3
- 2
- 1
Which of the following methods are not defined in the Graphics Class in Java?
- fillRect()
- fillCircle()
- fillOval()
- fillArc()
- None of these
How many parameters are passed to the constructor of the Font class in java?
- 5
- 4
- 3
- 2
- 1
Color c1 = new Color(284,60,189);
Which of the following statements about the given statement is/are correct?
- A new color will be created.
- runtime Exception
- Parameters are not enough
- Compile time error : Cannot find method color
- Compile time error : Color is Abstract, cannot create an object.
Which of the following source object do not generate the ActionEvent?
- JRadioButton
- JCheckBox
- JComboBox
- JList
- JTextField
How many primitive data types are available in Java?
- 9
- 6
- 8
- 7
- 5
Which of the following methods are valid in Java for handling Events?
- mouseEnetered()
- keyReleased()
- mouseDragged()
- Both (1) and (2)
- All of these
How many constructors are there for Layout manager FlowLayout?
- 5
- 4
- 3
- 2
- 1