You are not logged in.
Pages:: 1
#1 2015-06-16 06:04:28
Java Language Constructors-And-Methods Code:
Java Quizzes Java Language Constructors-And-Methods
Directions:
public class Test{
public static void printValue(int i, int j, int k){
System.out.println("int");
}
public static void printValue(byte...b){
System.out.println("long");
}
public static void main(String... args){
byte b = 9;
printValue(b,b,b);
}
}
Question:
What is the output for the below code?
Option A):
Compilation clean but throws RuntimeException
Option B):
long
Option C):
Compilation fails
Option D):
int
Correct Answer is Option D):
int
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-16 06:04:28
- Advertisement
- Ads By Google
Re: Java Language Constructors-And-Methods Code:
\n
Pages:: 1