Java Set-1 Answers
Java Set-1 Answers
It is portable.
Platform Independent
WORA:
is the feature applicable to those programs which hold the capability to execute itself on any operating
systems or on any machine. This terminology was given by Sun Microsystem for their programming
language - Java. According to this concept, the same code must run on any machine and hence the
source code needs to be portable
When we compile Java code then .class file is generated by javac compiler. These codes are readable by
JVM and every operating system have its own JVM so JVM is platform dependent but due to JVM java
language is become platform independent.
In general, open source refers to any program whose source code is made available for use or
modification as users or other developers see fit. Open source software is usually developed as a public
collaboration and made freely available.
WHAT IS AN ASSEMBLER:
The Assembler is used to translate the program written in Assembly language into machine code. The
source program is a input of assembler that contains assembly language instructions. The output
generated by assembler is the object code or machine code understandable by the computer.
COMPILER:
The language processor that reads the complete source program written in high level language as a
whole and translates it into an equivalent program in machine language is called as a Compiler.
Oak is a discontinued programming language created by James Gosling in 1991, initially for Sun
Microsystems' set-top box project. The language later evolved to become Java.
WHO WERE THE INVENTORS OF JAVA
Java programming language was invented by a group of engineers at the Sun Microsystems company,
led by engineer James Gosling. The team, which was known as the 'Green Team,' developed Java in
1991.
Java was originally developed by James Gosling at Sun Microsystems and released in 1995 as a core
component of Sun Microsystems' Java platform.
Oracle Corporation is the current owner of the official implementation of the Java.
JDK:
The Java Development Kit (JDK) is a software development environment used for developing Java
applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a
compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java
development.
JRE:
JRE stands for “Java Runtime Environment” and may also be written as “Java RTE.” The Java Runtime
Environment provides the minimum requirements for executing a Java application; it consists of the Java
Virtual Machine (JVM), core classes, and supporting files.
JDK:
Java Development Kit (in short JDK) is Kit which provides the environment to develop and execute(run)
the Java program. JDK is a kit(or package) which includes two thingS
JRE:
JRE is the region of memory to allocate on the memory for execution of particular java application.
JVM
Java Virtual machine(JVM) is a very important part of both JDK and JRE because it is contained or inbuilt
in both. Whatever Java program you run using JRE or JDK goes into JVM and JVM is responsible for
executing the java program line by line hence it is also known as interpreter.
JVM (Java virtual machine) is platform dependent while java language is platform independent.
JVM is one kind of interface or middleware between OS(Operating Systems) and java language.
JVM provides the environment to execute the java file(. Class file). So at the end it's depends on
your kernel. And kernel is differ from OS to OS. So JVM is platform dependent.
A Java class file is a file containing Java bytecode and having .class extension that can be
executed by JVM. A Java class file is created by a Java compiler from .java files as a result of
successful compilation.
Intermediate code is used to translate the source code into the machine code. Intermediate code
lies between the high-level language and the machine language.
JIT:
The JIT compiler helps improve the performance of Java programs by compiling bytecodes into
native machine code at run time. The JIT compiler is enabled by default. When a method has
been compiled, the JVM calls the compiled code of that method directly instead of interpreting
it.
Class loaders are responsible for loading Java classes during runtime dynamically to the
JVM (Java Virtual Machine). Also, they are part of the JRE (Java Runtime Environment).
Hence, the JVM doesn’t need to know about the underlying files or file systems in order to run
Java programs thanks to class loaders.
Also, these Java classes aren’t loaded into memory all at once, but when required by an
application. This is where class loaders come into the picture. They are responsible for loading
classes into memory.
INTERPRETER:
Interpreter is a translator which converts high level language code to machine level language line
by line.
2. Linking
Performance
Java programs take much longer time to run compared to C/C++.
Cost
Since memory and processing requirements higher, hardware cost increases.
Garbage collection
There is no control over garbage collection in Java. That is programmer does not have any right
to control the garbage collection. Java does not provide functions like delete(), free().
JDK 1.0. The first version was released on January 23, 1996.
A Java class file is a file containing Java bytecode that can be executed on the Java Virtual Machine. A
Java class file is usually produced by a Java compiler from Java programming language source files
containing Java classes..
Yes. In general object file formats might be the same, e.g. ELF, but the contents of the object files will
vary from system to system.
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.
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:
Pointer is a variable which can holds the address of another variable or object of same type.No,
java doesn't support pointer because improper handling of pointers lead to memory leaks and
readability issues
The difference between path and classpath is that path is an environment variable used to refer the
location of Java executable files while classpath is an environment variable used to refer the location of
the class files.
A Java library contains code which you can access and use in your Java project.
java.lang
java.util
java.math
The Data Library contains information about the original structure of the packages.
The Server hosting your application is running slow or running out of resources