Core Java Interview Questions
Questions Answers Views Company eMail

Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?

1 5262

This is related to threads. I have a class with synchronized method m1(). Can I create different instances of this class and execute the m1() for different threads?

3 4812

Advantages of Inheritance in java.

CybAge, HCL,

11 34527

what is the output??????? public class multireturn { public(int assign x ( int x) { if(4==x) { return 7; } else if (7=x+3) { return 6; } return 5; } }

TCS,

3 4683

how a marker interface gets its functionality and when we implements a marker interface how it got invoked

Mind Tree,

3 10394

how to handle a singleton service locator. when multiple threads are trying to get the singleton object in same time

Mind Tree,

4 9514

What code optimizations techniques you follow in general practice?

Accenture, TCS, Wipro,

2 5912

System.out.println("somestring"); It will create any object or not

CSC,

5 7206

________ exception must be either caught or specified in throws class of the method.

1 3165

Every class extends object but why it is not possible for every object to invoke clone() method. ideally protected methods should be accessible from sub classes. isn't it?

2 3752

Difference between JVM and JRE?

Amdocs,

3 5909

Diff between Comparator and Comparable?

Aditya Birla,

2 8308

what is the difference between object and class

IBM,

10 9454

There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.

3 5013

Is it possible to create object with out its default constructor? if possible how? else not possible? justify

5 6185


Post New Core Java Questions

Un-Answered Questions { Core Java }

Is java call by reference?

519


Is array a class?

506


What is the default value of float and double datatype in java?

519


How do you check if a string is lexicographically in java?

486


What is double data type?

531






Which is the class in java?

508


Which sort is best in java?

514


What is finalize()?

586


How do you sort in ascending order in java?

509


Is this valid in java ? Can we instantiate interface in java?

532


What restrictions are placed on method overriding?

633


Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.

7397


Why can't we make a class private in java?

526


What is the main advantage of passing argument by reference?

490


Can a boolean be null java?

527