S
Q. What would be the result of attempting to compile and run the following code?
Code:
public class HelloWorld{
public static void main(String[] args){
double[] x = new double[]{1, 2, 3};
System.out.println("Value is " + x[1]);
}
}
public static void main(String[] args){
double[] x = new double[]{1, 2, 3};
System.out.println("Value is " + x[1]);
}
}
- Correct Answer - Option(D)
- Views: 239
- Filed under category JAVA
Discusssion
Login to discuss.