Welcome Guest | Sign in | Register
Objects and Collections - Discussion Page For Q.2914 | 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(Byte I,Byte j ){
System.out.println(“BByte”); }
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 byte that to as primitive type it display output as byte.

Comment on this Question

Name:

Loading...




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