Interview Questions on C C++

Home  |  About Us  |  Contact
View Questions Contribute Training Misc..

You are here : Home » Java » Java Interview Questions on Variables

Java Interview Questions on Variables - 14 Questions


Question: 1

(A) 100
(B) 110
(C) 121
(D) 144

[Posted by: Admin | Location: Chicago, USA]



Question: 2

(A) 100
(B) 90
(C) 99
(D) 72

[Posted by: Admin | Location: Chicago, USA]



Question: 3

(A) Local variables are declared in methods, constructors, or blocks
(B) Local variables are created when the method, constructor or block is entered
(C) the variable will be destroyed once it exits the method, constructor, or block
(D) We can't create reference variables of Local variables

[Posted by: Admin | Location: Chicago, USA]



Question: 4

(A) True
(B) False

[Posted by: Admin | Location: Chicago, USA]



Question: 5

(A) 10"10"
(B) Compilation Error
(C) 20
(D) 1010

[Posted by: Admin | Location: Chicago, USA]



Question: 6

(A) 10-10
(B) 0
(C) 1010
(D) Compilation Error

[Posted by: Admin | Location: Chicago, USA]



Question: 7

(A) 10+10
(B) 1010
(C) Compilation Error
(D) Undefined

[Posted by: Admin | Location: Chicago, USA]



Question: 8

(A) 0
(B) 10"-10"
(C) 10-10
(D) Compilation Error

[Posted by: Admin | Location: Chicago, USA]



Question: 9

(A) 30
(B) 1020
(C) 10+10+10
(D) 1010+10

[Posted by: Admin | Location: Chicago, USA]



Question: 10

(A) Garbage Value
(B) Code has compilation error
(C) null
(D) 0

[Posted by: Admin | Location: Chicago, USA]



Question: 11

(A) Garbage Value
(B) 0
(C) Undefind
(D) Compilation Error

[Posted by: Admin | Location: Chicago, USA]



Question: 12

(A) 5
(B) 10
(C) Error: Can't assign a value to final variable a
(D) None of the above

[Posted by: Admin | Location: Chicago, USA]



Question: 13

(A) 0
(B) 10
(C) Undefind
(D) Error: Can't modify final variable a

[Posted by: Admin | Location: Chicago, USA]



Question: 14

(A) 5
(B) 10
(C) 0
(D) Error: variable a might already have been assigned

[Posted by: Admin | Location: Chicago, USA]


[Contribute to this Website]


Java Objective Questions By Different Categories:-
Datatype | Variables | Operators | Decision Making | Loops | Methods | Reference Variables | Arrays | Classes and Objects | Abstract Class | Singleton Class | Modifiers | Inheritance | Overriding | Polymorphism | Abstraction | Encapsulation | Files and I/O | TypeCasting | Packages | Exceptions | Collections Framework | Numbers Class | Date & Time | Regular Expressions | Data Structures | Interfaces | Serialization | Multithreading | Networking | Sending Email | Applet Basics | Other