Capgemni – Java Interview Questions
Here is the list Java Interview Questions which are recently asked in Capgemini company. These questions are included for both Freshers and Experienced professionals.
1. What is mean by Collections in Java?
Any group of individual objects which are represented as a single unit is known as the collection of the objects. In Java, a separate framework named the “Collection Framework” has been defined in JDK 1.2 which holds all the collection classes and interface in it.
2. What are all the Classes and Interfaces that are available in the collections?
Java Collection means a single unit of objects. Java Collection framework provides many interfaces (Set, List, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).
3. What is a Class?
A class is a user-defined type that describes what a certain type of object will look like. A class description consists of a declaration and a definition. It represents the set of properties or methods that are common to all objects of one type.
4. What is an Object?
A Java object is a combination of data and procedures working on the available data. The state of an object is stored in fields (variables), while methods (functions) display the object's behavior. Objects are created from templates known as classes.
5. What are the Oops concepts?
OOPs in Java organize a program around the various objects and well-defined interfaces. The OOPs Concepts in Java are abstraction, encapsulation, inheritance, and polymorphism. It aims to implement real-world entities in programs.
6. What is Inheritance?
Inheritance is a concept that acquires the properties from one class to other classes. A class can inherit attributes and methods from another class. The class that inherits the properties is known as the sub-class or the child class.
7. What are the differences between C++ and Java?
C++ uses only compiler, whereas Java uses compiler and interpreter both. C++ supports both operator overloading & method overloading whereas Java only supports method overloading.
Free PDF : Get our updated Java Course Content pdf
8. List the features of Java Programming language.
- Simple
- Object Oriented
- Robust
- Platform Independent
- Secure
- Multi Threading
- Architectural Neutral
- Portable
9. What do you understand by Java virtual machine?
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java byte code. The JVM reference implementation is developed by the OpenJDK project as open source code.
10. What is the difference between JDK, JRE, and JVM?
JDK is a software development kit whereas JRE is a software bundle that allows Java program to run, whereas JVM is an environment for executing byte code. The full form of JDK is Java Development Kit, while the full form of JRE is Java Runtime Environment, while the full form of JVM is Java Virtual Machine.
11. How many types of memory areas are allocated by JVM?
The memory in the JVM is divided into five different parts namely− Method area− the method area stores the class code − code of the variables and methods. Heap − The Java objects are created in this area. Java Stack− While running methods the results are stored in the stack memory.
12. What is JIT compiler?
The JIT compiler aids in improving the performance of Java programs by compiling byte code into native machine code at run time. The JIT compiler is enabled throughout, while it gets activated, when a method is invoked. For a compiled method, the JVM directly calls the compiled code, instead of interpreting it.
13. What is the platform?
Java platform is a collection of programs that help to develop and run programs written in the Java programming language. It includes an execution engine, a compiler, and a set of libraries. JAVA is platform-independent language. It is not specific to any processor or operating system.
14. What is classloader?
A class loader is an object that is responsible for loading classes. The class ClassLoader is an abstract class. Applications implement subclasses of ClassLoader in order to extend the manner in which the Java virtual machine dynamically loads classes.
15. What is the default value of the local variables?
The local variables do not have any default values in Java. This means that they can be declared and assigned a value before the variables are used for the first time, otherwise, the compiler throws an error.
Get Answer for all the above questions and place in your dream company
Wants to Become an Expert
in Java?
Know MoreTOP MNC's JAVA INTERVIEW QUESTIONS & ANSWERS
Here we listed all Java Interview Questions and Answers which are asked in Top MNCs. Periodically we update this page with recently asked Questions, please do visit our page often and be updated in Java.