Java Related Interview Questions
Questions Answers Views Company eMail

Why runnable interface is used in java?

564

How garbage collection is done in java?

544

There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

985

What is the base class in java from which all classes are derived?

511

Can we declare a class as abstract without having any abstract method?

547

Which of the following classes will have more memory allocated?

577

Does importing a package imports its sub-packages as well in java?

545

How objects of a class are created if no constructor is defined in the class?

576

Give an example of use of pointers in java class.

556

I want to persist data of objects for later use. What is the best approach to do so?

587

What is the purpose of static methods and static variables?

538

What are java packages?

578

What are the performance implications of interfaces over abstract classes?

1 2884

How can you generate random numbers in java?

577

When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

754


Un-Answered Questions { Java Related }

What are the advantages of java inner classes?

553


How is di implemented in the spring framework?

176


What is the use of @service annotation in spring?

168


What is slash r?

537


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

594






What is hibernate bag collection?

145


Explain how hashmap works?

586


What is the java reflection api? Why it’s so important to have?

548


What are dot operator queries?

621


What is a generic data type?

564


What’s the utilization of struts.xml configuration file?

529


What is the what is the difference between invokeandwait() and invokelater()? ?

627


Explain polymorphism citing an example.

584


What is ebxml?

506


Can I override protected method in java?

589