JavaQuizzes

Quiz Guidelines

 

Multiple Choice Question

QID: 
77

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

Multiple Choice Question

QID: 
78

Which of the following are valid identifiers?

Select 2 options

A. class
B. $value$
C. angstrom
D. 2much
E. zer@

Multiple Choice Question

QID: 
79

Given the following class, which of these are valid ways of referring to the class from outside of the package com.enthu?

package com.enthu;
public class Base{
// ....
// lot of code...
}

Select 2 options

A. Base
B. By importing the package com.* and referring to the class as enthu.Base
C. importing com.* is illegal.
D. By importing com.enthu.* and referring to the class as Base.
E. By referring to the class as com.enthu.Base.

Multiple Choice Question

QID: 
80

Which method declarations will enable a class to be run as a standalone program?

Select 2 options

A. static void main(String args[ ])
B. public void static main(String args[ ])
C. public static main(String[ ] argv)
D. final public static void main(String [ ] array)
E. public static void main(String args[ ])

Multiple Choice Question

QID: 
81

Which of the following are valid declarations of the standard main() method?

Select 2 options 

A. static void main(String args[ ]) { } 
B. public static int main(String args[ ]) {} 
C. public static void main (String args) { } 
D. final static public void main (String[ ] arguments ) { } 
E. public static void main (String[ ] args) { } 

Pages