Core Java interview questions – Part 6
91. What is java byte code?
Byte code is an sort of intermediate code. The byte code is processed by virtual machine.
92. What is method overloading?
Method overloading is the process of creating a new method with the same name and different signature.
93. What is method overriding?
Method overriding is the process of giving a new definition for an existing method in its child class.
94. What is finalize() ?
Finalize is a protected method in java. When the garbage collector is executes , it will first call finalize( ), and on the next garbage-collection it reclaim the objects memory. So finalize( ), gives you the chance to perform some cleanup operation at the time of garbage collection.
95. What is multi-threading?
Multi-threading is the scenario where more than one threads are running.
96. What is deadlock?
Deadlock is a situation when two threads are waiting on each other to release a resource. Each thread waiting for a resource which is held by the other waiting thread.
97. What is the difference between Iterator and Enumeration?
Iterator differ from enumeration in two ways Iterator allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics. And , method names have been improved.
98. What is the Locale class?
A Locale object represents a specific geographical, political, or cultural region
99. What is internationalization?
Internationalization is the process of designing an application so that it can be adapted to various languages and regions without changes.
100. What is anonymous class ?
An anonymous class is a type of inner class that don’t have any name.
101. What is the difference between URL and URLConnection?
A URL represents the location of a resource, and a URLConnection represents a link for accessing or communicating with the resource at the location.
102. What are the two important TCP Socket classes?
ServerSocket and Socket. ServerSocket is useful for two-way socket communication. Socket class help us to read and write through the sockets. getInputStream() and getOutputStream() are the two methods available in Socket class.
103. Strings are immutable. But String s=”Hello”; String s1=s+”World” returns HelloWorld how ?
Here actually a new object is created with the value of HelloWorld
104. What is classpath?
Classpath is the path where Java looks for loading class at run time and compile time.
105. What is path?
It is an the location where the OS will look for finding out the executable files and commands.