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 5297

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 4865

Advantages of Inheritance in java.

CybAge, HCL,

11 34659

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 4754

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

Mind Tree,

3 10464

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

Mind Tree,

4 9565

What code optimizations techniques you follow in general practice?

Accenture, TCS, Wipro,

2 5963

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

CSC,

5 7295

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

1 3204

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 3802

Difference between JVM and JRE?

Amdocs,

3 5974

Diff between Comparator and Comparable?

Aditya Birla,

2 8351

what is the difference between object and class

IBM,

10 9517

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 5061

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

5 6270


Post New Core Java Questions

Un-Answered Questions { Core Java }

What are decalarations?

647


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

595


How do you check if two given string are anagrams?

563


What are abstract methods in java?

664


What is number data type in java?

566






What is an example of declaration?

535


What is isa relationship?

576


What is the += operator called?

584


What are assembly attributes?

555


Explain the overview of UDP messaging.

743


What does bitwise or mean?

579


Why char array is favored over string for the storage of passwords?

567


How do you compare values in java?

559


Which sorting is used in arrays sort in java?

594


What is the difference between char and char *?

579