Frequently Asking Question
In this Java Interview Questions blog, we have compiled some of the most essential Java Programming Interview Questions and Answers which helps you stand a chance in the interview process.
Get Java Training from experts. Call us @ +91 86087 00340 for a free demo session!
Java Interview Question and Answers
- Explain about Object oriented programming Language.
- Does Constructor Return any value?
- Can we overload main() method?
- What is marker interface?
- Can an Interface be final?
- What is Exception Handling?
- What are the two types of Exceptions in Java ?
- What is multithreading?
- What are the basic interfaces of Java Collections Framework
- What are the JDBC API components?
- What are the steps to connect to the database in java?
- What are the JDBC Statements?
- Super class of Java
- Does Java support Multiple Inheritance?
- Why String is Immutable Object?
- Nested Forloops
- Basic inheritance program
- What is gc?
- What is the Difference Between HashSet and TreeSet
- What is the Difference Between Collection and Collections?
- What is the life-cycle of a Servlet?
- What is JSP?
- What is over loading and over riding ?
- What is Abstraction and Encapsulation ?
- What is array?
- How to reverse string without using reverse Method?
- Features of java?
- Write a query how delete rows from mysql.
- Difference between truncate,delete,drop.
- What are the jdbc drivers.
- What is Dynmic binding.
- Difference between string and string buffer.
- What is class and object?
- What are the access modifer in java?
- Difference between local and global variable.
Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance.
when you call the constructor using a new keyword you get an object. Though it doesn’t explicitly return something but instead it creates or constructs something which you can use as an instance of a class. yes, it is the current class instance. (We cannot use return type yet it returns a value).
yes we can overload main method. main method must not be static main method. Yes, main method can be overloaded.
A marker interface in Java is an interface with no fields or methods. Put more simply, an empty interface in Java is called a marker interface. Examples: Serializable , Cloneable and Remote interfaces.
An interface is a pure abstract class. Hence, all methods in an interface are abtract, and must be implemented in the child classes. So, by extension, none of them can be declared as final
An unexpected event that disturbs the normal flow of program.
- checked Exception
- Unchecked Exception
Multithreading in java is a process of executing multiple threads simultaneously. A thread is a lightweight sub-process, the smallest unit of processing. Multiprocessing and multithreading, both are used to achieve multitasking.
Java Collection means a single unit of objects. Java Collection framework provides many interfaces (Set, List, Queue, Deque) and classes (Array List, Vector, Linked List, Priority Queue, HashSet, Linked HashSet, TreeSet).
The JDBC API. The JDBC API gives access of programming data from the Java. JDBC Driver Manager. The JDBC Driver Manager is the class in JDBC API. JDBC Test Suite. JDBC-ODBC Bridge.
- Step 1: Register the Driver class
- Step 2: Create connection
- Step 3: Create statement
- Step 4: Execute queries
- Step 5: Close connection
It can be used for general-purpose access to the database. It is useful when you are using static SQL statements at Run time.
It can be used when you plan to use the same SQL statement many times. The Prepared Statement interface accepts input parameters at Run time.
Callable Statement can be used when you want to access database stored procedures.
The super keyword in Java is a reference variable which is used to refer immediate parent class object.
No..Java Does not Support Multiple in hesitance. Once string object is created its data or state can’t be changed but a new string object is created.
In Java, string objects are immutable. Immutable simply means unmodifiable or unchangeable.
public static void main(String  args)
public void add()
class B extends A
public static void main(String  args)
A ob=new A();
UN Reachable objects in program automatically eligible for garbage collection.
Java server page used for front end development. method overloading programm and methos overriding and differences
Overloading: same method but differnt parameters.
Overriding: same method name in different class.
Abstraction:hiding internal implementation.
Encapsulation:wrapping of data in single unit.
Collection of homogenous datatypes.
- platform indepdent
- object oriented
- high performance
Truncate: total rows from table
Drop: to delete the table from database
Delete: particular row from table
- JDBC-ODBC Bridge.
- Native api
- Network protocol
- Thin driver
From the reference of base class we can create object to derived class
String is an immutable object
String buffer is an mutable Object
Class is blue print of program
object is an reference of class
Local Variable Declared in side method
Global Variable Declared inside class out side method
Hope you have gone through these 35 Interview Questions with diligence. It is not only a learning experience but also helps you to crack the interview with confidence. Happy Java Job Searching!