Programming & Dev

Top 10 Java Interview Questions asked everywhere

Some info about Java Programming Language

JAVA is the most commonly used programming language with most of the IT companies recruiting Java developers. A lot of devices around the globe run on Java as it provides a cross-platform computing environment. Oracle Corporation currently owns Java. We will now see the most asked Interview Questions on JAVA.

This article is very beneficial for every graduate who is going to sit for placements tests, interviews, etc. Most of the software developer roles assigned to them revolve around only one supreme language which is java. It is probably because of its very rich environment and OOPs concept that most often questions are generally asked over the topics which are discussed below. So if you are anyone from the last year of graduation then just don’t leave until you read the whole article ;).

Interview Questions on JAVA

Top 10 Interview Questions on Java

Q1.What are the differences between JAVA and C++?

1. Java is an Object-Oriented programming language whereas C++ follows both OOP and Procedural Oriented paradigm.

2. C++ supports operator overloading concept whereas JAVA doesn’t.

3.Java doesn’t contain any Header files whereas in C++ header files are necessary to mention before starting your main program.

4.C++ makes use of multiple inheritances whereas JAVA doesn’t support multiple inheritances.

5.JAVA doesn’t support special variables like pointers but C++ does support pointers.

6.Java supports multi-threading whereas C++ didn’t support multi-threading but after the evolution of c++ to C++11 and C++14 multithreading features are now available in it.

Q2. What do you mean by an Object-oriented programming approach?

Object-Oriented Programming is an approach to bind the data members and the functions together under one entity-body or structure. It also helps in reusability of code by creating different objects of the same structure by implementing real-world entities like inheritance, the abstraction that is data hiding and polymorphism, etc in programming.

Q3. What does the term JVM stand for?

 It is a kind of virtual machine which helps users to run java programs as well as other programs written in other languages on any operating system or in short it provides a portable execution environment for java based application.

Q4.What is an object in Java?

An object in java is a self-contained body or unit which has some specific characteristics and functions as defined by the user in the class(blueprint in easy words).

Q5.What does JDK stand for?

JDK stands for Java Development Kit which includes JVM compiler, Debugger, and other essential components required for any software, applicationetc. development.

Q6.List some common built-in JAVA API packages?

Some of the common built-in JAVA API packages are:- It provides Input and Output support to the classes. It helps in the creation of applets. It supports networking. It helps in supporting thread, exceptions, strings, and many more. It supports in Hash tables, vectors, and others.

Q7. Explain the vector class in Java.

 Vector class refers to an array of growable objects. It is implemented with the help of an array list and rarely used in the non-threading environment. It implemented as a dynamic array which means it can grow or shrink as per the requirements of the user and hence is used to store a list of objects having a variable size.

Q8.List different packages of swings.

The different packages of swings are:-

1.javax.swing.undo: It provides support for undo/redo capabilities in the text editor.

2.javax.swing: It provides a set of Light-weight java language components.

3.javax.swing.event:It provides events closed by swing components.

4.javax.swing.tree: It provides interfaces and classes for dealing with javax.awt.swing.JTree

5.javax.swing.plaf: It provides many abstract classes to look at and feel capabilities and provides one interface.

Q9.Name some of the versions of JAVA.

1. Java Enterprise Edition(J2EE): It is used in the development and building of web-based enterprise applications. The J2EE platform consists of API, protocols, and services for developing web-apps which usually run on servers.

2. Java Micro Edition(J2ME): J2ME also previously known as Java 2 platform is used for deployment and development of code with portability features for mobile devices such as android phones, tablets, etc.

3. Java Standard Edition(J2SE): It helps in the development and deployment of portable codes for making normal applications developed by the java programming language in desktop and server environments.

Q10.What is Inheritance?

 Inheritance is the capability of a class to inherit the properties from another class in an object-oriented programming language. With the help of inheritance, one object can have some similar characteristics to that of another object. This helps in the re-usability of code and better efficiency of the program.

Get the latest tech news and updates, programming tutorials, and cyber security tips and tricks. Check out MeuSec for more.

Sometimes we include links to online retail stores and/or online campaigns. If you click on one and make a purchase we may receive a small commission.


Leave a Reply

Your email address will not be published. Required fields are marked *