Java Interview Questions And Answers: Applying for a job related to programming language requires some basic concepts to be very clear to face the interview and also to crack it.
Here our team has collected some commonly asked questions in java interview with their respective answers. Each questions has its own value. If you find some difficulties in learning or understanding these questions then you must go for some basic knowledge of java from online resources.
Java Interview Questions And Answers: If you are very new to Java language then lets go for a sort introduction for this programming language.
Java is a core back-end language use to develop or create applications which are machine independent and this machine independence makes this programming language unique.
Java Interview Questions And Answers
Now imagine that you are in an interview related to java question and answers just give your best for the following important questions.
1. Define the most important feature of Java?
Java is a platform independent language, This language uses java byte for its execution.
2. What do you understand by platform independence?
Platform independence can be understood by the writing and compiling the java code in one platform (for eg: Windows OS) and can execute the class in any other supported platform eg (Linux,Solaris,etc) also in hand held devices like smart phones.
3. What is a JVM?
JVM is fully known as Java Virtual Machine which is a run time environment for the compiled java class files and make a java program run in that environment.
4. Are JVM’s platform are independent?
JVM’s are not platform independent. JVM’s are platform specific run time implementation provided by the vendor hence that are not platform independent.
5. Can a class be defined as protected in JAVA?
The protected access modifier cannot be applied to class and interfaces in JAVA language. Methods, But the fields can be declared as protected, however methods and fields in a interface cannot be declared protected this is another unique about java.
6. What is the access scope of a protected method in JAVA Language?
A protected method can be used by the classes within the same package or by the sub-classes of the class in any package in java.
7. Can a abstract class be defined without any abstract methods?
Absolutely this is possible in java. This is used to avoid instance creation of the class in java.
8. Can a Class extend more than one Class?
Not this is not possible. A Class can extend to only one class but can implement any number of Interfaces or instances as an object.
9. What is casting in JAVA?
There are two types of casting, casting between object references and casting between primitive integer types. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference. Casting between integer types is used to convert larger values, such as double values, to mini values, such as byte values.
10. What are order of precedence and associativity, and how are they used in JAVA?
Associatity determines whether an expression is evaluated left-to-right or right-to-left. Order of precedence determines the order in which operators are evaluated in expressions.
I am very sure that these questions has build some confidence in you and now you can face your interview with some new ideas.
Also if you want to ask anything about java language then please put your questions in comments and we will notify you the best answer in you mail box.