Core Java Interview Questions . If there is any core java interview question that have been asked to you, kindly post it in the ask question section. We assure that you will get here the 9. The answers of the core java interview questions are short and to the point.
The core java interview questions are categorized in Basics of java interview questions, OOPs interview questions, String Handling interview questions, Multithreading interview questions, collection interview questions, JDBC interview questions etc. Core Java: Basics of Java Interview Questions. What is difference between JDK,JRE and JVM? JVMJVM is an acronym for Java Virtual Machine, it is an abstract machine which provides the runtime environment in which java bytecode can be executed. It is a specification.
It is the implementation of JVM. It physically exists. It contains JRE + development tools.
JIT compiles parts of the byte code that have similar functionality at the same time, and hence reduces the amount of time needed for compilation. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU. What is platform?
Interview Questions in Core Java. How does Java handle integer overflows and underflows? It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. What is the Vector class? Where can I get Core Java interview questions and answers with explanation? All students, freshers can download Core Java quiz questions with answers as PDF files and eBooks. Solved examples with detailed answer. Get Instant Access to free Read PDF Java Mcq Questions And Answers Free Download at Our Ebooks Unlimited Database. Common Core Standards In Diverse Classrooms Essential Practices For Developing Academic Language Pdf. Core Java Basics Quiz. Interview Questions » Java Interview » Servlet Interview.
A platform is basically the hardware or software environment in which a program runs. There are two types of platforms software- based and hardware- based. Java provides software- based platform. Java is compiled to be a byte code which is the intermediate language between source code and machine code.
This byte code is not platform specific and hence can be fed to any platform. What is classloader?
The classloader is a subsystem of JVM that is used to load classes and interfaces. There are many types of classloaders e. Bootstrap classloader, Extension classloader, System classloader, Plugin classloader etc. Is Empty . java file name a valid source file name?
Yes, save your java file by . Let's take a simple example.
A. But not null. 1. What if I write static public void instead of public static void? Program compiles and runs properly. What is the default value of the local variables? The local variables are not initialized to any default value, neither primitives nor object references. Core Java - OOPs Concepts: Initial OOPs Interview Questions. There is given more than 5.
OOPs (Object- Oriented Programming and System) interview questions. But they have been categorized in many sections such as constructor interview questions, static interview questions, Inheritance Interview questions, Abstraction interview question, Polymorphism interview questions etc.
Examples of object based programming languages are Java. Script, VBScript etc.
The object references are all initialized to null in Java. Core Java - OOPs Concepts: Constructor Interview Questions. What is constructor? Constructor is just like a method that is used to initialize the state of an object. It is invoked at the time of object creation. What is the purpose of default constructor?
The default constructor provides the default values to the objects. The java compiler creates a default constructor only if there is no constructor in the class. Does constructor return any value? Ans: yes, that is current instance (You cannot use return type yet it returns a value).
Is constructor inherited? No, constructor is not inherited.
Can you make a constructor final? No, constructor can't be final. Core Java - OOPs Concepts: static keyword Interview Questions.
What is static variable? But at runtime throws an error .
It represents IS- A relationship. It is used for Code Resusability and Method Overriding. Which class is the superclass for every class.
Object class. 3. 0) Why multiple inheritance is not supported in java? To reduce the complexity and simplify the language, multiple inheritance is not supported in java in case of class. What is composition?
Aggregation represents weak relationship whereas composition represents strong relationship. For example: bike has an indicator (aggregation) but bike has an engine (compostion).
Why Java does not support pointers? Pointer is a variable that refers to the memory address. They are not used in java because they are unsafe(unsecured) and complex to understand. What is super in java? It is a keyword that refers to the immediate parent class object. Can you use this() and super() both in a constructor? No. Because super() or this() must be the first statement.
It increases the readability of the program. Why method overloading is not possible by changing the return type in java? Becauseof ambiguity.
Can we overload main() method? Yes, You can have many main() methods in a class by overloading the main method. Core Java - OOPs Concepts: Method Overriding Interview Questions. What is method overriding: If a subclass provides a specific implementation of a method that is already provided by its parent class, it is known as Method Overriding. It is used for runtime polymorphism and to provide the specific implementation of the method. Can we override static method?
No, you can't override the static method because they are the part of class not object. Yes, all functions in Java are virtual by default. What is covariant return type?
Now, since java. 5, it is possible to override any method by changing the return type if the return type of the subclass overriding method is subclass type. It is known as covariant return type. If it is static blank final variable, it can be initialized only in the static block. Can you declare the main method as final? Yes, such as, public static final void main(String.
Our library can be accessed from certain countries only. Please, see if you are eligible to read or download our Java Mcq Questions With Answers content by creating an account. You must create a free account in order to read or download this book.