Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Java Assignment

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

1.What is Java Programming?

-Java was developed by James Gosling at Sun Microsystems Inc in May 1995 and later
acquired by Oracle Corporation. Java is a class-based, object-oriented programming language
that is designed to have as few implementation dependencies as possible. It is intended to let
application developers write once, and run anywhere (WORA), meaning that compiled Java
code can run on all platforms that support Java without the need for recompilation. Java was
first released in 1995 and is widely used for developing applications for desktop, web, and
mobile devices. Java is known for its simplicity, robustness, and security features, making it a
popular choice for enterprise-level applications.

2.What is the History of Java Programming?provide a detailed information.

-The story of Java begins in June 1991, when a small team of engineers at Sun Microsystems,
led by James Gosling, started a project called Green. The goal of the project was to develop a
programming language for consumer electronic devices, such as smart TVs, set-top boxes, and
handheld controllers. These devices needed a language that was simple, robust, portable, and
secure, as they had limited memory and processing power, and had to communicate with each
other over different networks.
The team initially named the language Greentalk, with the file extension .gt. Later, they renamed
it to Oak, after an oak tree that stood outside Gosling’s office. Oak was influenced by several
other languages, such as C, C++, Smalltalk, Lisp, and Ada. However, Oak was not designed for
the web, which was emerging as a new platform for distributed computing and information
sharing.They also decided to rename Oak to Java, as there was already another language
called Oak. The name Java was chosen because it was simple, unique, fun to say, and evoked
the idea of coffee, which the team consumed a lot during their long working hours. Java is not
an acronym; it is just a name.

3.What are the advantages of using Java Programs

—Java is easy to learn.


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.
One of the most significant advantages of Java is its ability to move easily from
one computer system to another. The ability to run the same program on many
different systems is crucial to World Wide Web software, and Java succeeds at
this by being platform-independent at both the source and binary levels.

Because of Java's robustness, ease of use, cross-platform capabilities and security


features, it has become a language of choice for providing worldwide Internet solutions.

4.What are the Processes of Java in Developing programs?

1. Requirements Gathering and Analysis:In this phase, the development


team works closely with stakeholders to gather and analyze requirements for
the software project.The goal is to understand the functionality, features, and
constraints of the system.Requirements are documented and analyzed to
create a clear understanding of what the software needs to accomplish.

2. System Design:Based on the gathered requirements, the system design


phase involves creating a high-level architecture for the software.Architects
and designers define the overall structure of the system, including modules,
components, and their interactions. Design decisions such as database
structure, user interface layout, and system architecture are made during
this phase

3. Implementation (Coding):In this phase, developers write the actual code


for the software based on the design specifications. Java is an
object-oriented programming language, so developers create classes and
methods to implement the functionalities outlined in the design
phase.Coding standards, best practices, and guidelines are followed to
ensure code quality and maintainability.
4. Testing:The testing phase involves systematically checking the software for
defects and verifying that it meets the specified requirements.Different types
of testing, including unit testing, integration testing, and system testing, are
performed. Java provides tools and frameworks like JUnit for automated
testing, making it easier to ensure the reliability and correctness of the code.

5. Deployment:Once the software has been thoroughly tested and deemed


ready for release, it is deployed to the production environment.Deployment
involves installing the software on servers, configuring it for production use,
and making it available to end-users. Java applications are typically
deployed as Java Archive (JAR) files, and web applications often use
technologies like JavaServer Pages (JSP) or servlets deployed on web
servers.

6. Maintenance and Support:After deployment, the software enters the


maintenance phase, where developers address any issues discovered in the
live environment and release updates or patches as needed.Maintenance
may also involve adding new features or enhancements based on user
feedback and changing requirements.Continuous monitoring and support
are essential to ensure the ongoing reliability and performance of the
software.

5.What are the components of java?

● Java Development Kit (JDK)


JDK plays a vital role when developing Java applications and programs. It is a software
development environment equipped with tools like a compiler, documentation generator,
interpreter, and many others. The compiler primarily helps in converting the Java code
into byte code.

Components included in JDK:

jConsole

jar

javap

jarSigner

jstack

javaws

keytool

policytool

● Java Virtual Machine (JVM)

Java applications are primarily called Write once Run Anywhere (WORA) because of
their ability to run on any platform. Amid this, JVM offers a runtime environment for
executing Java Code or applications, further converting Java bytecode into machine
language. Usually, in other programming languages, the compiler produces machine
code for a specific system, but the Java compiler initiates for JVM.

Components included in JVM:

ClassLoader Subsystem
Loading

Initialization

Linking

Stack

Runtime Data Area, which includes heap area, method area, etc.

● Java Runtime Environment (JRE)

– Equipped with loader class, class libraries, and JVM, JRE helps in running other
software. To explain in basic terminology, JRE is responsible to run a Java program.
All-in-all, JRE is installed on the computer system that takes hold of Java code, blends it
with the desired libraries, and allows JVM to execute it. A programmer needs JDK, and
if you are one, then you will need JDK. However, JRE’s role is limited to running Java
programs as it doesn’t flaunt tools related to development like compiler or debugger. But
if you wish to run Java applets, it is imperative to have JRE installed in your system. As
it is platform-dependent, you have to download and install JRE that is compatible with
your operating system.

Java components list in JRE:

Code libraries, resource files as well as property settings

DLL files

When it comes to extension, Java component example includes files related to locale
specification like localedata.jar
Security management files like java. security

Applet support classes

True Type font files.

6.What is Java Virtual Machine?

–The Java Virtual Machine is a virtual “machine” that provides a runtime environment for
Java applications and programs. Its role is simple: interpret and execute Java bytecode,
which a low-level representation of the compiled form of a piece of Java code. When
applications written in Java are compiled, they produce bytecode, which can be executed
(or run) by any JVM implementation, regardless of the underlying architecture, hardware, or
operating system.
Java’s JVM is platform-independent, meaning Java programs can be written once and run
on any JVM implementation – a principle known as WORA or write once, run anywhere.
This concept of WORA is achieved courtesy of a layer of abstraction residing between the
Java code and the underlying OS and hardware. At runtime, the JVM interprets the
resultant bytecode and translates it into native machine code, accounting for the
characteristics of the underlying system it will run on.

7.What is Java Application Program Interface?

– Like all APIs, Java API acts as an intermediary between different elements of an
information system or systems. However, Java API is different from most APIs in that its
functionality is largely internal in nature. It sits in between the JVM and the Java
program.
In practical terms, the Java API is integrated into the Java Development Kit (JDK). It
delivers a connection interface between different Java “classes,” as pre-created Java
code components are known, as well as between Java user interfaces and the
underlying JVM. The Java API explains the function of each class or interface. Using
Java API, a Java developer can utilize the various pre-written Java components.

You might also like