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

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

Q: Class Manager{
Public static void main(String args[]){
Double d=test(100);
System.out.println(“done”);
}
Static long test(float f){
return f; }
}
A. 100 B. done
C. compile time error D. runtime error

Answer and Explanation

Answer:compile time error

Explanation:

From main method() we are calling test() method by passing 100, but in a called function it is accepting of type float 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.