Welcome Guest | Sign in | Register
Final and Datatypes - Discussion Page For Q.2731 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Final and Datatypes > Questions and Answers

Q: Public class Manager{
Static final String name;
Static{
name=”lara”;
}
Public static void main(String args[]){
System.out.println(name.length()); } }
A. 0 B. null
C. compile time error D. 4

Answer and Explanation

Answer:4

Explanation:
final variable is initialized in a static block. So it will not throw any error.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.