WorksheetsJava Static_NonStatic
Total questions: 10
Worksheet time: 3mins
Name
Class
Date
1.
How to declare a Static variable
a)
int a= 10;
b)
static a= 200;
c)
static int a= 100;
2.
Static variable is a Global variable
a)
True
b)
False
3.
NonStatic Variable is a Local Variable
a)
True
b)
False
4.
Where can we declare a Static Variable
a)
inside main function
b)
outside main function
5.
Where can we declare a nonStatic Variable
a)
inside main function
b)
outside main function
6.
Where can we declare Local Variable
a)
inside main function
b)
outside main function
7.
Can static and nonStatic variables declared as public
a)
Yes
b)
No
8.
is Local Variable and NonStatic variable are same
a)
True
b)
False
9.
Can i have the same Global variable name for my Local Variable
a)
Yes
b)
No
10.
How to create an Object for my Class "Abc"
a)
Abc obj= new Abc;
b)
Abc = new Abc;
c)
Abc obj= new Abc();
100 %
