Most frequently asked TOP 82 Java Springs Multiple Choice Questions with Answers
1. What is the meaning of the return data type void?
2. A lower precision can be assigned to a higher precision value in JavA. For example a byte type data can be assigned to int type.
3. Which of the following statements about the Java language is true?
4. Which of the following statements is false about objects?
5. Which methods can access to private attributes of a class?
6. What is an aggregate object?
7. Assume that File is an abstract class and has toFile() methoD. ImageFile and BinaryFile are concrete classes of the abstract class File.Also, assume that the method toFile() is implemented in both Binary File and Image File. A File references an ImageFile object in memory and the toFile method is called, which implementation method will be called?
8. A class can have many methods with the same name as long as the number of parameters or type of parameters is different. This OOP concept is known as
9. Which of the following is considered as a blue print that defines the variables and methods common to all of its objects of a specific kind?
10. What are the two parts of a value of type double?
11. After the following code fragment, what is the value in fname?
12. What is the value of ‘number’ after the following code fragment execution?
13. Given the following code snippet;
14. Which of the following is not a return type?
15. If result = 2 + 3 * 5, what is the value and type of ‘result’ variable?
16. What is the data type for the number 9.6352?
17. Assume that the value 3929.92 is of type ‘float’. How to assign this value after declaring the variable ‘interest’ of type float?
18. Which of the following statements is true?
19. How many numeric data types are supported in Java?
20. Which of the following statements declare class Sample to belong to the payroll.admindept package?
21. The class java.lang.Exception is
22. Which of the following statements is true?
23. All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character) in java
24. The code snippet
25. Consider the following code snippet. What will be assigned to the variable fourthChar, if the code is executed?
26. Which of the following statements is preferred to create a string "Welcome to Java Programming"?
27. Which of the following statements is true?
28. What kind of thread is the Garbage collector thread is?
29. When a thread terminates its processing, into what state that thread enters?
30. Which statement is true?
31. Which of these statements is true?
32. Which of the following is synchronized?
33. Select all the true statements from the following.
34. Which of the methods should be implemented if any class implements the Runnable interface?
35. A thread which has invoked wait() method of an object, still owns the lock of the object. Is this statement true or false?
36. Which of the following is not a method of the Thread class.
37. To execute the threads one after another
38. The object of DataInputStream is used to
39. DataInputStream is an example of
40. From a MVC perspective, Struts provides the
41. Consider the following program:
42. Which of the following is TRUE?
43. Consider the following code snippet
44. A constructor
45. Which of the following may be part of a class definition?
46. What is different between a Java applet and a Java application?
47. Considerpublic class MyClass{public MyClass(){/*code*/}// more code...}To instantiate MyClass, you would write?
48.What is byte code in the context of Java?
49.What is garbage collection in the context of Java?
50.You read the following statement in a Java program that compiles and executes.submarine.dive(depth);What can you say for sure?
51. Formed on a diskette (or hard drive) during initialization.
52. The CPU consists of:
53. OOP stands for:
54. Output printed on paper.
55. A binary digit (1 or 0) signifying "on" or "off".
56. Our decimal number 44, when represented in binary, is:
57. Byte code is the machine language for a hypothetical computer called the:
58. Equals 8 bits.
59. Java allows for three forms of commenting:
60. To prepare a diskette (or hard drive) to receive information.
61. In Java, the name of the class must be the same as the name of the .java file.
62. The name Java was derived from
63. Programs that tell a computer what to do.
64. RAM stands for _________.
65. Several computers linked to a server to share programs and storage space.
66. Source code in Java will not run if it is not indented.
67. When working in Java with JBuilder, each program you write should be assigned to a new project.
68. The four equipment functions of a computer system.
69. Translates and executes a program line by line.
70. The physical components of a computer system.
71. Struts was first developed
72. The reset method on an ActionForm
73. Each Struts Action element is uniquely identified by its
74. The name of the Application Resources file is set by the servlet init-param named
75. The validating init-param of the ActionServlet is used to
76. To specify an ActionMapping to use when a request doesn't match any other mapping, you can
77. If you have created a custom ActionMapping subclass with the property "service", you can initialize the value to "selectRecord" using
78. In Struts 1.1, you can change how Struts populates a form by
79. The <bean:write> tag is:
80. To prevent possible security issues with the <html:password> tag, you should
81. To localize Tiles, you can
82. To localize Validator forms, you can
1. What is the meaning of the return data type void?
2. A lower precision can be assigned to a higher precision value in JavA. For example a byte type data can be assigned to int type.
3. Which of the following statements about the Java language is true?
4. Which of the following statements is false about objects?
5. Which methods can access to private attributes of a class?
6. What is an aggregate object?
7. Assume that File is an abstract class and has toFile() methoD. ImageFile and BinaryFile are concrete classes of the abstract class File.Also, assume that the method toFile() is implemented in both Binary File and Image File. A File references an ImageFile object in memory and the toFile method is called, which implementation method will be called?
8. A class can have many methods with the same name as long as the number of parameters or type of parameters is different. This OOP concept is known as
9. Which of the following is considered as a blue print that defines the variables and methods common to all of its objects of a specific kind?
10. What are the two parts of a value of type double?
11. After the following code fragment, what is the value in fname?
12. What is the value of ‘number’ after the following code fragment execution?
13. Given the following code snippet;
14. Which of the following is not a return type?
15. If result = 2 + 3 * 5, what is the value and type of ‘result’ variable?
16. What is the data type for the number 9.6352?
17. Assume that the value 3929.92 is of type ‘float’. How to assign this value after declaring the variable ‘interest’ of type float?
18. Which of the following statements is true?
19. How many numeric data types are supported in Java?
20. Which of the following statements declare class Sample to belong to the payroll.admindept package?
21. The class java.lang.Exception is
22. Which of the following statements is true?
23. All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character) in java
24. The code snippet
25. Consider the following code snippet. What will be assigned to the variable fourthChar, if the code is executed?
26. Which of the following statements is preferred to create a string "Welcome to Java Programming"?
27. Which of the following statements is true?
28. What kind of thread is the Garbage collector thread is?
29. When a thread terminates its processing, into what state that thread enters?
30. Which statement is true?
31. Which of these statements is true?
32. Which of the following is synchronized?
33. Select all the true statements from the following.
34. Which of the methods should be implemented if any class implements the Runnable interface?
35. A thread which has invoked wait() method of an object, still owns the lock of the object. Is this statement true or false?
36. Which of the following is not a method of the Thread class.
37. To execute the threads one after another
38. The object of DataInputStream is used to
39. DataInputStream is an example of
40. From a MVC perspective, Struts provides the
41. Consider the following program:
42. Which of the following is TRUE?
43. Consider the following code snippet
44. A constructor
45. Which of the following may be part of a class definition?
46. What is different between a Java applet and a Java application?
47. Considerpublic class MyClass{public MyClass(){/*code*/}// more code...}To instantiate MyClass, you would write?
48.What is byte code in the context of Java?
49.What is garbage collection in the context of Java?
50.You read the following statement in a Java program that compiles and executes.submarine.dive(depth);What can you say for sure?
51. Formed on a diskette (or hard drive) during initialization.
52. The CPU consists of:
53. OOP stands for:
54. Output printed on paper.
55. A binary digit (1 or 0) signifying "on" or "off".
56. Our decimal number 44, when represented in binary, is:
57. Byte code is the machine language for a hypothetical computer called the:
58. Equals 8 bits.
59. Java allows for three forms of commenting:
60. To prepare a diskette (or hard drive) to receive information.
61. In Java, the name of the class must be the same as the name of the .java file.
62. The name Java was derived from
63. Programs that tell a computer what to do.
64. RAM stands for _________.
65. Several computers linked to a server to share programs and storage space.
66. Source code in Java will not run if it is not indented.
67. When working in Java with JBuilder, each program you write should be assigned to a new project.
68. The four equipment functions of a computer system.
69. Translates and executes a program line by line.
70. The physical components of a computer system.
71. Struts was first developed
72. The reset method on an ActionForm
73. Each Struts Action element is uniquely identified by its
74. The name of the Application Resources file is set by the servlet init-param named
75. The validating init-param of the ActionServlet is used to
76. To specify an ActionMapping to use when a request doesn't match any other mapping, you can
77. If you have created a custom ActionMapping subclass with the property "service", you can initialize the value to "selectRecord" using
78. In Struts 1.1, you can change how Struts populates a form by
79. The <bean:write> tag is:
80. To prevent possible security issues with the <html:password> tag, you should
81. To localize Tiles, you can
82. To localize Validator forms, you can