Core Java Interview Questions – Set 22

Is Java Pass by Reference or Pass by Value? The Java Spec says that everything in Java is pass-by-value. There is no such thing as “pass-by-reference” in Java. The difficult thing can be to understand that Java passes “objects as references” passed by value. Which class is the immediate superclass of the Container class Component. … Read more

Core Java Interview Questions – Set 21

What is difference between HashMap and HashSet HashSet : HashSet does not allow duplicate values. It provides add method rather put method. You also use its contain method to check whether the object is already available in HashSet. HashSet can be used where you want to maintain a unique list. HashMap : It allows null for both key … Read more

Core Java Interview Questions – Set 20

Where is native modifier used It can refer only to methods and it indicates that the body of the method is to be found else where and it is usually written in non java language When do you use continue and when do you use break statements When continue statement is applied it prematurely completes … Read more

Core Java Interview Questions – Set 19

What is a stream and what are the types of Streams and classes of the Streams A Stream is an abstraction that either produces or consumes information. There are two types of Streams and they are: Byte Streams: Provide a convenient means for handling input and output of bytes. Character Streams: Provide a convenient means … Read more

Core Java Interview Questions – Set 18

How is rounding performed under integer division The fractional part of the result is truncated. This is known as rounding toward zero. Why are the methods of the Math class static So they can be invoked as if they are a mathematical code library. When are automatic variable initialized Automatic variable have to be initialized … Read more