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

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

Q: Class F
{
Static void test(Long i){
System.out.println(“long”);
}
Public static void main(String args[]){
byte s=10;
test(s);
}
}
A. compile time error B. runtime error
C. long D. 0

Answer and Explanation

Answer:compile time error

Explanation:
Here byte is a primitive type variable and we are trying to store in Long which is of type class ,so it will throw compile time error

Comment on this Question

Name:

Loading...




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