Java Junior

10 Questions | Total Attempts: 4800

SettingsSettingsSettings
Please wait...
Java Quizzes & Trivia

It is created for Beginners in Java. This is to test the knowledge of any Java Developer wannabe.


Questions and Answers
  • 1. 
    If none of the private/protected/public is specified for a member, that member ...
    • A. 

      Is accessible publicly

    • B. 

      Is only accessible by other classes of the same package

    • C. 

      Is only accessible from within the class

    • D. 

      Is accessible by the class and its subclasses

  • 2. 
    Which one is not correct?
    • A. 

      A class needs to be instantiated as an object before being used

    • B. 

      An objects exists in memory in run time

    • C. 

      Class and object are just different names for the same thing

    • D. 

      An object is a variable, where its type is the class used to declare the variable

  • 3. 
    Which is not a part of defining an object?
    • A. 

      Description

    • B. 

      Methods

    • C. 

      Associations with other objects

    • D. 

      Name

  • 4. 
    Class B inherits from Class A, what cannot be said:
    • A. 

      B is a sub-class of A

    • B. 

      A is a super-class of B

    • C. 

      B has access to private members of A

    • D. 

      B has access to protected members of A

  • 5. 
    What is a member of a class
    • A. 

      An attribute

    • B. 

      A method

    • C. 

      Attribute or method

    • D. 

      A sub-class

  • 6. 
    A class is...
    • A. 

      An object

    • B. 

      An executable piece of code

    • C. 

      An abstract definition of an object

    • D. 

      A varibale

  • 7. 
    Which package do you need to use widgets such as JApplet, JFrame, JPanel and JButton?
    • A. 

      Javax.swing

    • B. 

      Javax.gui

    • C. 

      Java.awt

    • D. 

      Java.swing

  • 8. 
    Which one needs a web page to run
    • A. 

      A Java Application

    • B. 

      A Java Stand-Alone Application

    • C. 

      A Java Applet

    • D. 

      A Java Class

  • 9. 
    How to define a JButton with the caption test?
    • A. 

      JButton aButton('test');

    • B. 

      JButton aButton=new JButton("test");

    • C. 

      JButton aButton=new JButton('test');

    • D. 

      JButton("test") aButton;

  • 10. 
    The last value in an array called ar can be found at index:
    • A. 

      0

    • B. 

      1

    • C. 

      Ar.length

    • D. 

      Ar.length - 1

Back to Top Back to top