Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

1.What is platform independent?

Ans: Platform Independent:

Java is platform independent because it is different from other languages like C, C++, etc. which
are compiled into platform specific machines while Java is a write once, run anywhere language.
A platform is the hardware or software environment in which a program runs.

There are two types of platforms software-based and hardware-based. Java provides a software-
based platform.

The Java platform differs from most other platforms in the sense that it is a software-based
platform that runs on top of other hardware-based platforms. It has two components:

1. Runtime Environment
2. API(Application Programming Interface)

Java code can be executed on multiple platforms, for example, Windows, Linux, Sun Solaris,
Mac/OS, etc. Java code is compiled by the compiler and converted into bytecode. This bytecode
is a platform-independent code because it can be run on multiple platforms, i.e., Write Once and
Run Anywhere (WORA).

2>What is open source?

Ans: The term “open source” refers to computer software or applications where the owners
or copyright holders enable the users or third parties to use, see, and edit the product’s source
code. The source code of an open-source OS is publicly visible and editable. The usually
operating systems such as Apple’s Ios, Microsoft’s Windows, and Apple’s Mac OS are closed
operating systems. Open-Source Software is licensed in such a way that it is permissible to
produce as many copies as you want and to use them wherever you like. It generally uses fewer
resources than its commercial counterpart because it lacks any code for licensing, promoting
other products, authentication, attaching advertisements, etc.

The open-source operating system allows the use of code that is freely distributed and available
to anyone and for commercial purposes. Being an open-source application or program, the
program source code of an open-source OS is available. The user may modify or change those
codes and develop new applications according to the user requirement. Some basic examples of
the open-source operating systems are Linux, Open Solaris, Free RTOS, Open BDS, Free BSD,
Minix, etc.

3>Difference between JDK,JRE,JVM?

ANS: JVM

JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because it doesn't
physically exist. It is a specification that provides a runtime environment in which Java bytecode
can be executed. It can also run those programs which are written in other languages and
compiled to Java bytecode.

JVMs are available for many hardware and software platforms. JVM, JRE, and JDK are platform
dependent because the configuration of each OS

is different from each other. However, Java is platform independent. There are three notions
of the JVM: specification, implementation, and instance.
67.2M
1.3K
Exception Handling in Java - Javatpoint

The JVM performs the following main tasks:

o Loads code
o Verifies code
o Executes code
o Provides runtime environment

More Details.

JRE

JRE is an acronym for Java Runtime Environment. It is also written as Java RTE. 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.

The implementation of JVM is also actively released by other companies besides Sun Micro
Systems.
JDK

JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) 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:

o Standard Edition Java Platform


o Enterprise Edition Java Platform
o Micro Edition Java Platform

The JDK contains a private Java Virtual Machine (JVM) and a few other resources such as an
interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator
(Javadoc), etc. to complete the development of a Java Application.
4>why we go for java?

Ans: Java was designed to be easy to use and is therefore easy to write, compile,
debug, and learn than other programming languages. Java is object-oriented. This allows
you to create modular programs and reusable code. Java is platform-independent.
5>What is the latest version of JDK and which version you are using in your project?

Ans: Java 17 is the latest version of Java available offering long term support (LTS).

It's important to note that even in 2022, many applications continue to run on Java 8
and Java 11. While Java 17 offers LTS, it's certainly not unusual if your application is
using 11 or even 8.

6>What is the latest version of eclispe and which version you are using in your
project?

 Eclipse 4.7 (June 2017) (Oxygen)


7>Difference between c++ and java?

Ans: C++ and Java differ in their platform dependency, memory management, and use
of classes. C++ is platform dependent and needs to be compiled on every platform. Java is
platform-independent. Once it's compiled into bytecode it can be executed on any platform.

8>Features of java?

Ans: A list of the most important features of the Java language is given below.

1. Simple 2.Object-Oriented 3.Portable 4.Platform independent 5.Secured 6.Robust

7.Architecture neutral 8.Interpreted 9.High Performance 10.Multithreaded 11.Distributed


12.Dynamic

9>What type of tool you are using in your project to execute java?

Ans: ECLIPSE IDE(TOOL) is one of the most important tools for Java programmers.
There are several IDEs (Integrated Development Environments) that are widely used by Java
developers such as NetBeans or Eclipse. IntelliJ IDEA is also an IDE which has many good
features that could help Java developers create robust Java application.

10>Difference between class,method,object?

Ans: An object is an element (or instance) of a class; objects have the behaviors of their
class. The object is the actual component of programs, while the class specifies how
instances are created and how they behave. method: a method is an action which an object is
able to perform.

11>Where object stores?


Ans: heap Memory. In Java, all objects are dynamically allocated on Heap. This is different
from C++ where objects can be allocated memory either on Stack or on Heap.
12>How to access one class method into different package class?
Ans: By creating Object reference and it will get import automatically
13>Coding standard to create project,class,method,package and object ?
Ans:
Class It should start with the uppercase letter. public class Employee
It should be a noun such as Color, Button, System, Thread, etc. {
Use appropriate words, instead of acronyms. //code snippet
}

Method It should start with lowercase letter. class


It should be a verb such as main(), print(), println(). Employee
If the name contains multiple words, start it with a lowercase letter {
followed by an uppercase letter such as actionPerformed(). // method
void draw()
{
//code
snippet
}
}

Package It should be a lowercase letter such as java, lang. //package


If the name contains multiple words, it should be separated package com.javatpoint;
by dots (.) such as java.util, java.lang. class Employee
{
//code snippet
}

14>What gives Java it's "write once and run anywhere" nature?
Ans: Platorm independent. This bytecode is a platform-independent code because it can be run on multiple
platforms, i.e., Write Once and Run Anywhere (WORA).

You might also like