Quiz
Java MCQ
Fragen in diesem Quiz (2)
1Which of these cannot be declared static?
- Aclass
- Bobject
- Cvariable
- Dmethod
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);
}
}- A1 2
- B1 1
- C2 2
- Dcompilation Error
Informationen
- Beschreibung
- To understand the concepts in java
- Autor
- Bharathy Kgisl
- Sprache
- English
- Aufrufe
- 60
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz