Question 1. What Is The Main Difference Between Java Platform And Other Platforms?
The Java platform differs from maximum other systems inside the sense that it’s a software program-based totally platform that runs on top of other hardware-primarily based platforms.
It has two additives:
API(Application Programming Interface)
Question 2. When Abstract Methods Are Used?
If you want a class to contain a particular method however you want the actual implementation of that technique to be decided by way of toddler instructions, you could declare the method within the figure elegance as summary.
Adv Java Interview Questions
Question 3. What Are Wrapper Classes?
These are instructions that permit primitive sorts to be accessed as items.
Example: Integer, Character, Double, Boolean and so forth.
Question 4. What Do You Mean By Platform Independence?
Platform independence means that we are able to write and compile the java code in one platform (eg Windows) and might execute the elegance in every other supported platform eg (Linux,Solaris,and so forth).
Adv Java Tutorial
Question 5. What Is A Pointer And Does Java Support Pointers?
Pointer is a reference take care of to a memory vicinity. Improper dealing with of pointers ends in reminiscence leaks and reliability problems as a result Java doesn’t help the usage of recommendations.
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 not brought into string pool even as String created the use of literal are created in String pool itself which exists in PermGen area of heap.
String s = new String(“Test”);
does no longer positioned the object in String pool , we need to call String.Intern() approach that is used to put them into String pool explicitly. Its only when you create String object as String literal e.G. String s = “Test” Java robotically placed that into String pool.
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 usually. The code in eventually block will execute even supposing an exception is occurred. Finally block is NOT referred to as in following conditions
If the JVM exits at the same time as the strive or catch code is being carried out, then the ultimately block may not execute. This may also appear because of System.Exit() name.
If the thread executing the attempt or capture code is interrupted or killed, the ultimately block may not execute even though the application as an entire maintains.
If a exception is thrown in finally block and now not handled then last code in eventually block might not be executed.
Core Java Tutorial Java-Springs Interview Questions
Question eight. What’s The Difference Between The Methods Sleep() And Wait()?
The code sleep(2000); puts thread aside for precisely seconds. The code wait(2000), reasons a wait of up to two 2d. A thread may want to prevent ready earlier if it receives the notify() or notifyAll() call. The approach wait() is described within the elegance Object and the method sleep() is described within the magnificence Thread.
Question nine. What Is The Difference Between An Interface And An Abstract Class ?
An abstract elegance could have instance methods that implement a default behavior. An Interface can simplest claim constants and instance techniques, but can not put in force default conduct and all methods are implicitly abstract. An interface has all public members and no implementation.
Java & EJB & Spring Interview Questions
Question 10. Difference Between Final, Finally And Finalize ?
Final is used to apply restrictions on class, technique and variable. Final elegance can’t be inherited, very last approach can’t be overridden and final variable price can’t be modified.
Finally is used to place vital code, it'll be carried out whether or not exception is handled or no longer.
Finalize is used to perform clean up processing simply before item is garbage amassed.