Question 1. What Is The Main Difference Between Java Platform And Other Platforms?
The Java platform differs from maximum other platforms within the sense that it’s a software-based totally platform that runs on top of different hardware-based structures.It has two additives:
API(Application Programming Interface)
Question 2. When Abstract Methods Are Used?
If you want a category to include a specific method but you need the real implementation of that approach to be decided by child classes, you can claim the method inside the figure magnificence as abstract.
J2EE Interview Questions
Question three. What Are Wrapper Classes?
These are classes that allow primitive types to be accessed as items. Example: Integer, Character, Double, Boolean and so forth.
Question 4. What Do You Mean By Platform Independence?
Platform independence way that we can write and bring together the java code in one platform (eg Windows) and can execute the class in some other supported platform eg (Linux,Solaris,and so forth).
Question five. What Is A Pointer And Does Java Support Pointers?
Pointer is a reference cope with to a memory region. Improper handling of suggestions results in reminiscence leaks and reliability issues hence Java doesn’t help the use of tips.
Core Java Interview Questions
Question 6. What Is The Difference Between Creating String As New() And Literal?
When we create string with new() Operator, it’s created in heap and now not delivered into string pool even as String created the use of literal are created in String pool itself which exists in PermGen region of heap.
String s = new String(“Test”);
does now not put the object in String pool , we want to name String.Intern() method that is used to position them into String pool explicitly. Its simplest whilst you create String object as String literal e.G. String s = “Test” Java mechanically placed that into String pool. ( Deloitte JAVA interview questions )
Question 7. What Is The Use Of The Finally Block? Is Finally Block In Java Guaranteed To Be Called? When Finally Block Is Not Called?
Finally is the block of code that executes always. The code in finally block will execute although an exception is befell. Finally block is NOT referred to as in following situations
If the JVM exits even as the attempt or seize code is being done, then the subsequently block may not execute. This might also manifest due to System.Go out() name.
If the thread executing the attempt or seize code is interrupted or killed, the in the end block might not execute despite the fact that the utility as an entire continues.
If a exception is thrown in eventually block and no longer dealt with then closing code in eventually block won't be performed.
Core Java Tutorial JDBC Interview Questions
Question 8. What’s The Difference Between The Methods Sleep() And Wait()?
The code sleep(2000); puts thread aside for precisely two seconds. The code wait(2000), causes a wait of up to 2 2d. A thread could forestall ready in advance if it receives the notify() or notifyAll() call. The technique wait() is described within the class Object and the approach sleep() is described in the magnificence Thread.
Question 9. What Is The Difference Between An Interface And An Abstract Class ?
An summary magnificence will have instance methods that enforce a default behavior. An Interface can best declare constants and example strategies, but can not enforce default behavior and all strategies are implicitly abstract. An interface has all public individuals and no implementation.
JSP Interview Questions
Question 10. Difference Between Final, Finally And Finalize ?
Final is used to apply restrictions on magnificence, approach and variable. Final elegance can’t be inherited, very last method can’t be overridden and final variable price can’t be changed.
Finally is used to region essential code, it will likely be executed whether or not exception is handled or no longer.
Finalize is used to perform smooth up processing simply earlier than item is garbage amassed.