Welcome Guest | Sign in | Register
Final and Datatypes - Discussion Page For Q.2744 | 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:long

Explanation:
Here byte is a primitive type variable and we are trying to store in long which is also of type primitive, so it will not throw any error, so ans is C

Comment on this Question

Name:

Loading...




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