Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Check your progress

1. The basic objective behind developing the language, Java, was to create software that could work for______ . A. Internet B. Consumer electronic devices C. World wide web D. None of above 2. The different types of programs that can be create with the help of Java are __________ and ________. A. Applets B. Applications C. Versions D. Machines 3. Which are Java development tools under the JDK? A. javac B. javam C. java D. javar

Java Simplified / Session 1 / 1 of 34

Check your progress


4. Which of the following are the features of Java2. A. Swing B. AWT C. Drag and Drop D. Java 2D API

Java Simplified / Session 1 / 2 of 34

Check your progress


5. The_____ keyword is used to access a method in other package. A. export B. import C. include D. None of the above 6. The ___ declaration must follow the import statements. A. Package B. Variable C. Class D. None of the above 7. A _____ is a smallest individual unit in a program A. class B. method C. variable D. separators

Java Simplified / Session 4 / 3 of 20

Check your progress


8. The ____ keyword is used to create an object A. static B. final C. new D. public 9. ____ implies that the method does have a code, and has must be implemented in the subclass A. static B. public C. private D. abstract 10. When the constructor or a classis not defined, the JVM provide a ____ constructor A. default B. implicit C. parameterized D. None of above
Java Simplified / Session 4 / 4 of 20

Check your progress

11. Which of the following are jump statement? A. goto B. break C. continue D. jump 12. A while loop executes et least _____, even if the specified condition is false A. Once B. Twice C. Not even once D. None of above
Java Simplified / Session 4 / 5 of 20

Check your progress


13. Suppose salaries is an array containing floats. Which of the following are valid loop control statements for processing each element of salaries? A. for (float f:salaries) B. for (int i:salaries) C. for (float f::salaries) B. for (int i::salaries) 14. Which of the following are legal? (Choose all that apply) A. for (int i=0, j=1; i<10; i++, j++) B. for (int i=0, j=1; ; i++, j++) C. for (int i=0, float j=1; ; i++, j++) D. for (String s = ; s.length() < 10; s+=!)

Java Simplified / Session 4 / 6 of 20

Check your progress


15. The_____ keyword is used to access a method in other package. A. export B. import C. include D. None of the above 16. The ___ declaration must follow the import statements. A. Package B. Variable C. Class D. None of the above

Java Simplified / Session 4 / 7 of 20

Check your progress


17. Which of the following should always be caught. A. Runtime exception B. Checked exception C. Assertion errors D. Errors other than assertions 18. Which of the following are legal argument types for a switch statement? A. byte B. int C. long D. float E. char F. String

Java Simplified / Session 4 / 8 of 20

Check your progress


19. When does an exceptions stack trace get recorded in the exception object? A. When the exception is constructed B. When the exception is thrown C. When the exception is caught 20. Suppose the type of Xarr is an array of XXX, and the type of Yarr is an array of YYY. When is the assignment Xarr = Yarr; legal? A. Sometimes B. Always C. Never
Java Simplified / Session 4 / 9 of 20

You might also like