ZOHO – Java Interview Questions
Here is the list Java Interview Questions which are recently asked in ZOHO company. These questions are included for both Freshers and Experienced professionals.
1. What is Java?
Java is a general-purpose, class-based, object-oriented programming language designed for having lesser implementation dependencies. It is fast, secure, and reliable computing platform for application development.
2. What are the differences between C++ and Java?
C++ uses only compiler, supports both operator overloading & method overloading and supports manual object management with the help of new and delete keywords whereas Java uses compiler and interpreter both, supports method overloading and has built-in automatic garbage collection.
3. List the features of Java Programming language.
- Object Oriented. In Java, everything is an Object.
- Platform Independent.
4. What do you understand by Java virtual machine?
The Java Virtual Machine (JVM) is the runtime engine of the Java Platform, which allows program written in Java or other language compiled into Java bytecode to run on any computer that has a native JVM. The compiled program can be cached in the computer for reuse.
5. What is the difference between JDK, JRE, and JVM?
JDK expands as Java Development Kit is a software development kit whereas JRE (Java Runtime Environment) is a software bundle that allows Java program to run, whereas JVM is referred as Java Runtime Environment is an environment for executing bytecode.
6. What is JIT compiler?
A just-in-time (JIT) compiler is a compiler that compiles code during program execution, rather than ahead of time. Traditional compilers compiled code, transitioning between code input and machine language, well before runtime. A JIT compiler is a way to compile in real time or on the fly as the program executes.
7. What are Java Packages? What's the significance of packages?
Package in Java is a mechanism to encapsulate a group of classes, sub packages and interfaces. Packages are used for: Preventing naming conflicts. For example there can be two classes with name Employee in two packages, college.
8. Can we declare a class as Abstract without having any abstract method?
Yes, we can declare an abstract class without any abstract method. The purpose of declaring a class as abstract is not to instantiate the class. Declaring a abstract class means that it cannot be instantiated on its own and can only be sub classed.
9. What's the difference between an Abstract Class and Interface in Java?
The Main difference is methods of a Java interface are implicitly abstract and cannot have implementations. An abstract class is used to define a contract, method implementations for the subclass, whereas an interface is used to define a contract for subclasses.
10. How an object is serialized in java?
To serialize an object means to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object. A Java object is serializable if class or any its superclass implements java.
11. When we should use serialization?
Serialization in Java allows us to convert an Object to stream that we can send over the network or save it as file or store in DB for later usage. Its main purpose is to save the state of an object in order to be able to recreate it when needed.
12. When the constructor of a class is invoked?
Each time an object is created using a new() keyword, at least one constructor is invoked to assign initial values to the data members of the same class. A constructor is invoked at the time of object or instance creation.
13. Is String a data type in java?
A String in Java is actually a non-primitive data type, because it refers to an object. The String object has methods that are used to perform certain operations on strings.
14. Why Strings in Java are called as Immutable?
String is Immutable in Java because String objects are cached in String pool. Since cached String literals are shared between multiple clients there is always a risk, where one client's action would affect all another client.
15. What is multi-threading?
Multithreading in Java is a process of executing two or more threads simultaneously to maximum utilization of CPU. Its applications execute two or more threads run concurrently. Hence, it is also known as Concurrency in Java. Each thread runs parallel to each other.
16. Why Runnable Interface is used in Java?
The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run. It is designed to provide a common protocol for objects that wish to execute code while they are active.
TOP 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.