Skip to main content

Top 10 Core Java Interview Question and Answers.

Q1.What is Java?
Ans-
Java is the high-level, object-oriented, robust, secure programming language, platform-independent, high performance, Multithreaded, and portable programming language. It was developed by James Gosling in June 1991. It can also be known as the platform as it provides its own JRE and API.

Q2.What do you understand by Java virtual machine?
Ans-
Java Virtual Machine is a virtual machine that enables the computer to run the Java program. JVM acts like a run-time engine which calls the main method present in the Java code. JVM is the specification which must be implemented in the computer system. The Java code is compiled by JVM to be a Bytecode which is machine independent and close to the native code.

Q3.What is the difference between JDK, JRE, and JVM?
Ans-
JVM:
JVM is an acronym for Java Virtual Machine; it is an abstract machine which provides the runtime environment in which Java bytecode can be executed. It is a specification which specifies the working of Java Virtual Machine. Its implementation has been provided by Oracle and other companies. Its implementation is known as JRE.

JVMs are available for many hardware and software platforms (so JVM is platform dependent). It is a runtime instance which is created when we run the Java class. There are three notions of the JVM: specification, implementation, and instance.

JRE:
JRE stands for Java Runtime Environment. It is the implementation of JVM. The Java Runtime Environment is a set of software tools which are used for developing Java applications. It is used to provide the runtime environment. It is the implementation of JVM. It physically exists. It contains a set of libraries + other files that JVM uses at runtime.

JDK:
JDK is an acronym for Java Development Kit. It is a software development environment which is used to develop Java applications and applets. It physically exists. It contains JRE + development tools. JDK is an implementation of any one of the below given Java Platforms released by Oracle Corporation:

Standard Edition Java Platform
Enterprise Edition Java Platform
Micro Edition Java Platform

Q4.What is JIT compiler?
Ans-
Just-In-Time(JIT) compiler: It is used to improve the performance. JIT compiles parts of the bytecode that have similar functionality at the same time, and hence reduces the amount of time needed for compilation. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU.

Q5.What are the main differences between the Java platform and other platforms?
Ans-
There are the following differences between the Java platform and other platforms.

Java is the software-based platform whereas other platforms may be the hardware platforms or software-based platforms.
Java is executed on the top of other hardware platforms whereas other platforms can only have the hardware components.

Q6.What gives Java its ‘write once and run anywhere’ nature?
Ans-
The bytecode. Java compiler converts the Java programs into the class file (Byte Code) which is the intermediate language between source code and machine code. This bytecode is not platform specific and can be executed on any computer.

Q7.What is classloader?
Ans-
Classloader is a subsystem of JVM which is used to load class files. Whenever we run the java program, it is loaded first by the classloader. There are three built-in classloaders in Java.

Bootstrap ClassLoader: This is the first classloader which is the superclass of Extension classloader. It loads the rt.jar file which contains all class files of Java Standard Edition like java.lang package classes, java net package classes, java.util package classes, java.io package classes, java.sql package classes, etc.
Extension ClassLoader: This is the child classloader of Bootstrap and parent classloader of System classloader. It loads the jar files located inside $JAVA_HOME/jre/lib/ext directory.
System/Application ClassLoader: This is the child classloader of Extension classloader. It loads the class files from the classpath. By default, the classpath is set to the current directory. You can change the classpath using “-cp” or “-classpath” switch. It is also known as Application classloader.

Q8.What is the platform?
Ans-
A platform is the hardware or software environment in which a piece of software is executed. There are two types of platforms, software-based and hardware-based. Java provides the software-based platform.

Q9.Is delete, next, main, exit or null keyword in java?
Ans-
No.

Q10.If I don’t provide any arguments on the command line, then what will the value stored in the String array passed into the main() method, empty or NULL?
Ans-
It is empty, but not null.

Meet The Experts For Better Guidence : https://nareshit.com/core-java-online-training/

Comments

Popular posts from this blog

The Best 10 Tips on How to Use rockbird media to Grow your Business

  Photo credit: rockbird media - Bespoke Meeting. “Your company can grow to its highest potential by investing in numerous summits and conventions. To identify the business solutions you require, use innovation and keep up with emerging industry trends.” Business owners have many different tasks to juggle on a day-to-day basis. One of those tasks may be creating and publishing content for their website or blog. If you're feeling overwhelmed by the task, or don't have the time to do it yourself, consider using rockbird media. Rockbird can help you create an online strategy that will reach new customers and grow your business. Plus, our team of skilled professionals can take care of all of the content creation for you. So what are you waiting for? Contact us today and let us show you how we can help your business rock! Are you looking for a way to take your business to the next level? Rockbird media can help! We are a full-service media company that can help you with everything f

How to speed up HP LAPTOP and speed it up|contact hp support

Speed is a major concern in HP laptops, like any other laptop. If your hp helpline number is running slow, learn the basic steps here to make your hp contact number +1-800-673-8163 faster and quicker. Below, you will find steps with complete instructions to speed up your HP laptop, if you want a technician help from professionals, use the hp support phone number to reach the best help desk. Either your laptop is new or old, the most important thing is that you need to update your laptop with the latest OS, or the update is fully installed. Call our 24*7 HP Helpdesk number 1-800-673-8163. Find support options like Chat, Phone Support or email helpdesk specific to your HP products. Looking to Contact HP helpdesk? Or Need support with your HP device. Don't panic, Contact us & let our HP helpdesk support specialists to set you back up. Microsoft Windows 10 is a default part of all new HP notebooks in 2018; so it is not enough to have Windows 10 OS on your new laptop. When Windows i

Hearing Aid Brands - Ashclinic

5% of the world’s population suffers from hearing loss. Helen Keller once said, Blindness separates people from things; Deafness separates people from people. Not being able to hear your loved ones is the most traumatic experience, and We at Atharva Speech & Hearing Care Pvt Ltd understand this and work hard everyday to provide you with end-to-end solutions so that you can experience the beauty of hearing your loved ones. Atharva Speech and Hearing care is the hearing aid service provider with hearing centers spread all over Mumbai and Goa. Founded in 1998, Atharva speech and hearing care have more than 22 years of experience in treating hearing loss with different types of hearing devices. https://www.ashclinic.com/index.html, Atharva Speech & Hearing Care Pvt Ltd is known for treating it’s patients with high quality services and with utmost care and warmth. You experience hearing loss, when you are not able to hear sound partially or completely with both your ears. Hearin