Core Java Interview Question and Answers
Core Java Interview Question and Answers: Core Java refers to the fundamental concepts and features of the Java programming language that form the basis for developing applications in Java. It includes the syntax, language constructs, and standard libraries provided by the Java Development Kit (JDK). Core Java also encompasses object-oriented programming principles such as encapsulation, inheritance, and polymorphism, which allow for efficient and reusable code. Here we are Providing Important Core Java Interview Question and Answers.
What is Core Java?
Answer: Core Java is a high-level programming language that is widely used to develop applications for desktop, web, and mobile platforms. It was developed by Sun Microsystems and is now owned by Oracle Corporation.
What are the main features of Core Java?
Answer: The main features of Core Java include platform independence, object-oriented programming, robustness, security, portability, scalability, and high-performance.
What is the difference between JDK, JRE, and JVM?
Answer: JDK (Core Java Development Kit) is a software development kit that contains tools for developing and debugging Core Java applications. JRE (Core Java Runtime Environment) is a software package that contains the Core Java Virtual Machine (JVM) and other libraries necessary for running Core Java applications. JVM (Core Java Virtual Machine) is a virtual machine that runs Core Java bytecode.
What is the difference between an interface and an abstract class?
Answer: An interface is a collection of abstract methods that define a contract for classes that implement it. An abstract class is a class that cannot be instantiated and may contain abstract methods as well as concrete methods.
What is the difference between a class and an object?
Answer: A class is a blueprint or template for creating objects, while an object is an instance of a class.
What is method overloading in Core Java?
Answer: Method overloading is a feature in Core Java that allows a class to have multiple methods with the same name but different parameters.
What is method overriding in Core Java?
Answer: Method overriding is a feature in Core Java that allows a subclass to provide its own implementation of a method that is already defined in its super class.
What is a constructor in Core Java?
Answer: A constructor is a special method that is used to initialize objects of a class. It has the same name as the class and no return type.
What is the difference between static and non-static methods?
Answer: Static methods belong to a class and can be called without creating an instance of the class. Non-static methods belong to an instance of a class and can only be called on that instance.
What is the difference between final, finally, and finalize in Core Java?
Answer: final is a keyword used to declare constants or to prevent a class, method, or variable from being modified. finally is a block of code that is executed after a try-catch block, regardless of whether an exception is thrown or not. finalize is a method that is called by the garbage collector before an object is destroyed.
Other Interview Question and Answers :