placeholder image to represent content

L-2 Class and Objects

Quiz by Archana Shelke

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    1. All methods and variables in Java language are kept inside a?
    main
    static method
    File
    Class or Interface
    60s
  • Q2
    2. In an object oriented programming
    Classes use methods to communicate between them
    Class create objects
    None of these
    Objects create classes
    60s
  • Q3
    3. What is the need to mention "static" before main method?
    Both A and B
    B. To make main method as class method common to all instances
    None of the above
    A. To call main method without creating an object of class
    60s
  • Q4
    4. In standalone Java applications, which method is mandatory?
    print method
    show method
    main method
    display method
    60s
  • Q5
    5. What is the use of Access modifier "pubic" in Java language?
    None of the above
    To call the main method outside of Class or Package by JVM
    To protect main method
    To hide the main method from misuse
    60s
  • Q6
    6. Choose a Single Line Comment in Java Language below?
    Some comments//
    /*Some comments*/
    */Some comments/*
    //Some comments
    60s
  • Q7
    7. Choose a multiline comment in Java language below?
    //comments are going cars are moving//
    */comments are going cars are moving/*
    /*comments are going cars are moving*/
    60s
  • Q8
    8. String args[] in main method are used for? public static void main(String args[]) { // }
    Nothing
    Passing arguments at run time
    Counting number of words
    Passing arguments at compile time
    60s
  • Q9
    9. What is the default return type of a method in Java language?
    short
    int
    None of these
    void
    60s
  • Q10
    10. Choose a correct version of Java Documentation Comment?
    /** comments **/
    /* comments **/
    /** comments */
    /* comments */
    60s
  • Q11
    11. A Java class can contain___.
    Methods, Constructors
    Variables
    All of these
    Inner Classes (A class inside another class)
    60s
  • Q12
    12. How many maximum numbers of objects can be created from a single Class in Java?
    64
    None
    256
    32
    60s
  • Q13
    13. In Java, the keyword used to declare a class is ___.
    Class
    Java
    java
    class
    60s
  • Q14
    14. Choose the correct statements about choosing a name for a class in Java.
    The class name can not start with a number
    The class name can start with only a letter or underscore or dollar sign.
    All of these
    The class name can contain numbers
    60s
  • Q15
    15. Choose the correct way of creating an object of the below class. class Table { Table(){System.out.println("Table Created");} }
    None of these
    Table() t = new Table();
    Table t = new Table;
    Table t = new Table();
    60s

Teachers give this quiz to your class