Multiple Choice Question

Quiz Guidelines

 

QID: 
62
Tags: 
Question: 

Consider the following two classes defined in two .java files.

//in file /root/com/foo/X.java

package com.foo;
public class X{
public static int LOGICID = 10;
public void apply(int i){
System.out.println("applied");
}
}

//in file /root/com/bar/Y.java

package com.bar;
//1 <== INSERT STATEMENT(s) HERE
public class Y{
public static void main(String[] args){
System.out.println(X.LOGICID);
}
}

What should be inserted at //1 so that Y.java can compile without any error?

Select 1 option

A. import static X;
B. import static com.foo.*;
C. import static com.foo.X.*;
D. import com.foo.*;
E. import com.foo.X.LOGICID;

Q&A Set: