java basics technical interview question
91. How many objects are created in the following piece of code? MyClass c1, c2, c3; c1 = new MyClass […]
91. How many objects are created in the following piece of code? MyClass c1, c2, c3; c1 = new MyClass […]
85. Is delete a keyword in Java? No. delete is not a keyword in Java. Java does not make use
73. What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to an
67. What is daemon thread and which method is used to create the daemon thread? Daemon thread is a low
61. When a thread is created and started, what is its initial state? A thread is in the ready state
49. If I want an object of my class to be thrown as an exception object, what should I do?
37. What is the common usage of serialization? Whenever an object is to be sent over the network, objects need
109. What is the difference between an if statement and a switch statement? The if statement is used to select
97. What are the legal operands of the instanceof operator? The left operand is an object reference or null value
97. What are the legal operands of the instanceof operator? The left operand is an object reference or null value
91. Name the eight primitive Java types. The eight primitive types are byte, char, short, int, long, float, double, and
85. Is null a keyword? The null value is not a keyword. 86. Which characters may be used as the
79. What are order of precedence and associativity, and how are they used? Order of precedence determines the order in
73. What do you understand by private, protected and public? These are accessibility modifiers. Private is the most restrictive, while
67. Which class is extended by all other classes? The Object class is extended by all other classes. 68. Which
55. Why does Java not support operator overloading? Operator overloading makes the code very difficult to read and maintain. To
25. Can a class declared as private be accessed outside it’s package? Not possible. 26. Can a class be declared
13. What are instance variables? Instance variables are those which are defined at the class level. Instance variables need not
7. What is the base class of all classes? java.lang.Object 8. Does Java support multiple inheritance? Java doesn’t support multiple
What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by
49. The mean distance of the earth from the sun is approximately A. 149,502,000 km B. 150,503,000 km
Directions to Solve In each of the following questions, five words have been given out of which four are alike
6. Study the diagram and identify the people who can speak only one language. A. L + M + O
Directions to Solve Each of these questions given below contains three elements. These elements may or may not have some
21. If A + B means A is the brother of B; A % B means A is the father