Welcome Guest | Sign in | Register
Objects and Collections - Discussion Page For Q.2913 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Objects and Collections > Questions and Answers

Exercise:

Section 1

Q: class W{
Static void method(int I,int j ){
System.out.println(“int”); }
Static void method(byte…b){
System.out.println(“byte”); }

Public static void main(String args[]){
byte i=10;
method(i,i); }
}
A. compile time error B. runtime error
C. int D. byte

Answer and Explanation

Answer:int

Explanation:
while calling method() from main() we are passing exactly two parameter as byte , as we are calling by passing only two so it will display int.

Comment on this Question

Name:

Loading...




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