JAVA MCQ
JAVA MCQ
E STUDENTS) Multiple Choice Questions Set II 1. Which language is not a true object-oriented programming language? a.) VB.NET b.) VB 6 c.) C++ d.) C# 2. Which one of these lists contains only Java programming language keywords? a. class, if, void, long, Int, continue b. goto, instanceof, native, finally, default, throws c. try, virtual, throw, final, volatile, transient d. strictfp, constant, super, implements, do 3. Which will legally declare, construct, and initialize an array? a. int [] myList = {"1", "2", "3"}; b. int [] myList = (5, 8, 2); c. int myList [] [] = {4,9,7,0}; d. int myList [] = {4, 3, 7}; 4. Which is a reserved word in the Java programming language? a. Method b. Native c. Subclasses d. Reference 5. Which is a valid keyword in java? a. Interface b. String c. Float d. Unsigned 6. A GUI: a.) uses buttons, menus, and icons. b.) should be easy for a user to manipulate.
c.) stands for Graphic Use Interaction. d.) Both a and b. 7. Visual Studio .NET provides which feature: a.) debugging. b.) application deployment. c.) syntax checking. d.) All of the above. 8. What does IDE stand for? a.) Integrated Development Environment b.) Integrated Design Environment c.) Interior Development Environment d.) Interior Design Environment 9. An object is composed of: a.) properties. b.) methods. c.) events. d.) All of the above. 10. Which statement about objects is true? a.) One object is used to create one class. b.) One class can create many objects b.) One class is used to create one object. c.) One object can create many classes. 11. The .Net class library: a.) contains over 25,000 classes. b.) uses namespaces to manage all of the classes. c.) has the System.Form namespace for classes used in Windows-based application. d.) Both a and b. 12. Which is not an integer data type? a.) Single b.) Byte c.) Short d.) Integer 13. Which of the following option is not true about java programming language?
(a) Java is high level programming language. (b) Java is a platform. (c) javac is compiler. (d) Byte code is executed by CPU. 14. Which is a not characteristic of java programming language? (a) Robust (b)Procedural (c) Distributed (e) Multithreaded 15. Which of the following is true about of java hotspot virtual machine? (a) It is additional virtual machine which improves the performance of an application. (b) It is internal device which convert source code into byte code. (c) It is virtual machine which detects runtime exception. (d) All are true. 16. Which of the following is correct? (a) Java platform is software only platform that runs on the top of other hardware based platform. (b) Java platform has two components: JVM, API. (c) Java technology is programming language as well as platform (d) All of the above. 17. Which of them is a not command line tool? (a) java (b) javaw (c) javapath (d) javadoc 18. Which not true about API in java?
(a) API stands for application package interface. (b) It is large collection of software components. (c) It is large array of useful class. (d) It is grouped into the package of related class. 19. Which of the following is not true in java? (a) Java platform is bit faster than actual CPU platform. (b) javac is compiler tool. (c) java command launch an application. (d) javadoc is documentation tool. 20. If you access an uninitialized local variable will result a. Syntax Error b. Compile Time Error c. Run Time Error d. No Error 21. How many type of primitive data types exists in Java a. 5 b. 7 c. 8 d. 10 22. A collection of methods with no implementation is called a. Polymorphism b. Inheritance c. Interface d. Data binding 23. What is the correct signature of the main method a. public static void main(String[] args) b. static public void main(String[] args) c. public void main(String[] args) d. A and B Both 24. Which is not a valid comment style in java a. /*comment*/
25. Ability to take many forms is called a. Polymorphism b. Encapsulation c. Member function d. Inheritance 26. A virtual function is a member function that expects to be a. Privatw b. Overridden c. Ignored d. Called frequently 27. For proper display of polymorphism, a method in the base class must be declared a. Private b. Public c. Protected d. Virtual 28. All the classes in a package can be simultaneously imported using a. * b. / c. $ d. & 29. The main subclass of the Exception class is a. RuntimeException Class 30. All standard classes of Java are included within a package called a. Java.exe b. java.lang c. java.awt d. java.apps
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
B b d b A d d a d b d a D B D D C A A b C c d b A b d a a B
VB 6 goto, instanceof, native, finally, default, throws int myList [] = {4, 3, 7}; native interface Both a and b All of the above Integrated Development Environment All of the above One class can create many objects Both a and b single Byte code is executed by CPU Procedural All are true All of the above javapath API stands for application package interface Java platform is bit faster than actual CPU platform Compile Time Error 8 interface A and B Both /* comment polymorphism overriden virtual * RuntimeException Class Java.lang