Submitted by c-admin on Mon, 05/27/2019 - 22:11
Which of the following keywords may occur multiple times in a Java source file?
Select 4 options
A. import
B. class
C. private
D. package
E. public
Submitted by c-admin on Mon, 05/27/2019 - 22:09
Identify valid modifiers for a top level class and method declarations.
(Assume that the class is not declared in another class)

Submitted by c-admin on Sun, 05/26/2019 - 00:11
Which of the following are keywords in Java?
Select 4 options
A. default
B. NULL
C. String
D. throws
E. long
F. strictfp
Submitted by c-admin on Sun, 05/26/2019 - 00:09
What is meant by "encapsulation"?
Select 1 option
A. There is no way to access member variable.
B. There are no member variables.
C. Member fields are declared private but public accessor/mutator methods are provided to access and change their values.
D. Data fields are declared public and accessor methods are provided to access and change their values.
E. None of the above.
Submitted by c-admin on Sun, 05/26/2019 - 00:06
Consider the following two classes defined in two java source 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){
X x = new X();
x.apply(LOGICID);
}
}
What should be inserted at //1 so that Y.java can compile without any error?
Select 2 options
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;
Pages