Core Java Interview Questions
Questions Answers Views Company eMail

What is garbage collection in Java, and how can it be used ?

Infosys, HCL, Accenture, Wipro, Sara, SITS,

32 54502

Differentiate Vector and ArrayList?

Wipro, Max Telecom,

6 7029

Differentiate constructor and a method and how are it be used?

Wipro,

6 7590




What is an abstract class?

Wipro,

7 6427

How can final class be used?

Wipro, Accenture,

5 8325

By what default value is an object reference declared as an instance variable?

Wipro,

1 9610

Java support what type of parameter passing ?

Wipro,

7 10953

Explain the term serialization?

Wipro,

10 8763




Is there is any error if you have multiple main methods in the same class?

Wipro, Infosys,

10 10064

What is Overriding and how can it be used?

Consagous, Wipro,

7 12709

Explain pass by reference and pass by value?

IBM, Wipro,

8 10849

In which way does a Primitive data type is passed ?

Sun Microsystems,

5 6977

What happens when a main method is declared as private?

L&T, DELL, Infosys, Sun Microsystems,

21 33137

Is there any need to import java.lang package?

Sun Microsystems,

13 14073

What is UNICODE?

3 3979


Post New Core Java Questions








Un-Answered Questions { Core Java }

what is collatration?

1667


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

590


How to display names of all components in a Container?

1684


Why does java not allow multiple public classes in a java file ?

1933


Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.

1462






Explain all java features with real time examples

446


What is procedure overloading?

935


What are the restrictions imposed by a Security Manager on Applets?.

1244


3.2 Consider the following class: public class Point { protected int x, y; public Point(int xx, int yy) { x = xx; y = yy; } public Point() { this(0, 0); } public int getx() { return x; } public int gety() { return y; } public String toString() { return "("+x+", "+y+")"; } } Say you wanted to define a rectangle class that stored its top left corner and its height and width as fields. 3.2.1 Why would it be wrong to make Rectangle inherit from Point (where in fact it would inherit the x and y coordinates for its top left corner and you could just add the height and width as additional fields)? (1) 8 Now consider the following skeleton of the Rectangle class: public class Rectangle { private Point topLeft; private int height, width; public Rectangle(Point tl, int h, int w) { topLeft = tl; height = h; width = w; } public Rectangle() { this(new Point(), 0, 0); } // methods come here } 3.2.2 Explain the no-argument constructor of the Rectangle class given above. 3.2.3 Write methods for the Rectangle class to do the following: • a toString() method that returns a string of the format "top left = (x, y); height = h; width = w " where x, y, h and w are the appropriate integer values. • an above() method that tests whether one rectangle is completely above another (i.e. all y values of the one rectangle are greater than all y values of the other). For example, with the following declarations Rectangle r1 = new Rectangle(); Rectangle r2 = new Rectangle(new Point(2,2), 1, 4); the expression r2.above(r1) should give true, and r2.above (r2) should give false. (You can assume that the height of a rectangle is never negative.) (2) (5)

734


How to print nodes of a Binary tree?

999


In a container there are 5 components. I want to display all the component names, how will you do that?

768


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

1254


What collections you have worked on? Internal working of Hashmap?

976


v-model life cycle

716


explain the concept of virtual method invocation in polymorphism in detail?

951