GoConqr has a new look! Let us know what you think.

Quiz

Java MCQ

Bharathy Kgisl 2 questions

Take the quiz

Questions in this quiz (2)

  1. 1Which of these cannot be declared static?
    1. Aclass
    2. Bobject
    3. Cvariable
    4. Dmethod
  2. 2class access{
    static int x;
    void increment(){
    x++;
    }
    }
    class static_use {
    public static void main(String args[])
    {
    access obj1 = new access();
    access obj2 = new access();
    obj1.x = 0;
    obj1.increment();
    obj2.increment();
    System.out.println(obj1.x + " " + obj2.x);
    }
    }
    1. A1 2
    2. B1 1
    3. C2 2
    4. Dcompilation Error

Information

Description
To understand the concepts in java
Language
English
Views
60
Tags
java
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?