0% found this document useful (0 votes)
77 views7 pages

Types of Java Applications: Cs8383 Object Oriented Programming Laboratory

The document discusses Java programming concepts including the Java Development Kit (JDK), Java Runtime Environment (JRE), Java Virtual Machine (JVM), and types of Java applications. It also provides an example Java program to calculate simple interest and questions for a viva voce exam.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views7 pages

Types of Java Applications: Cs8383 Object Oriented Programming Laboratory

The document discusses Java programming concepts including the Java Development Kit (JDK), Java Runtime Environment (JRE), Java Virtual Machine (JVM), and types of Java applications. It also provides an example Java program to calculate simple interest and questions for a viva voce exam.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

20.6.

19

CS8383 OBJECT ORIENTED PROGRAMMING LABORATORY

Java is a programming language and a platform.

Java is a high level, robust, object-oriented and secure programming language.

class Simple
{
public static void main(String args[])
{
System.out.println("Hello Java");
}
}

Types of Java Applications


There are mainly 4 types of applications that can be created using Java programming:

1) Standalone Application

Standalone applications are also known as desktop applications or window-based applications.


These are traditional software that we need to install on every machine. Examples of standalone
application are Media player, antivirus, etc. AWT and Swing are used in Java for creating
standalone applications.

2) Web Application

An application that runs on the server side and creates a dynamic page is called a web
application. Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF, etc. technologies are used for
creating web applications in Java.

3) Enterprise Application

An application that is distributed in nature, such as banking applications, etc. is called enterprise
application. It has advantages of the high-level security, load balancing, and clustering. In Java,
EJB is used for creating enterprise applications.
4) Mobile Application

An application which is created for mobile devices is called a mobile application. Currently,
Android and Java ME are used for creating mobile applications.

Java Platforms / Editions


There are 4 platforms or editions of Java:

1) Java SE (Java Standard Edition)

It is a Java programming platform. It includes Java programming APIs such as java.lang, java.io,
java.net, java.util, java.sql, java.math etc. It includes core topics like OOPs, String, Regex,
Exception, Inner classes, Multithreading, I/O Stream, Networking, AWT, Swing, Reflection,
Collection, etc.

2) Java EE (Java Enterprise Edition)

It is an enterprise platform which is mainly used to develop web and enterprise applications. It is
built on the top of the Java SE platform. It includes topics like Servlet, JSP, Web Services, EJB,
JPA, etc.

3) Java ME (Java Micro Edition)

It is a micro platform which is mainly used to develop mobile applications.

4) JavaFX

It is used to develop rich internet applications. It uses a light-weight user interface API.

JDK(Java Development Kit.)

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=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
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.

To run a java program you need JRE.

JRE (Java Runtime Environment)

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.

JRE = JVM + Java Packages Classes(like util, math, lang, awt,swing etc)+runtime
libraries.
JVM(Java Virtual Machine)
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

JVM=Interpreter/LOader(java)+Compiler(Javac)+an archiver(jar)+a
documentation generator(javadoc)

source files(.java) gets complied into byte code(.class)


Classloader: is the subsystem of JVM that is used to load class files.
Bytecode Verifier: checks the code fragments for illegal code that can violate access right to
objects.
Interpreter: read bytecode stream then execute the instructions.

As we all aware when we compile a Java file, output is not an ‘exe’ but it’s a ‘.class’ file. ‘.class’
file consists of Java byte codes which are understandable by JVM. Java Virtual Machine
interprets the byte code into the machine code depending upon the underlying operating system
and hardware combination. It is responsible for all the things like garbage collection, array
bounds checking, etc… JVM is platform dependent. There are specific implementations of the
JVM for different systems (Windows, Linux, MacOS, see the wikipedia list..), the aim is that
with the same bytecodes they all give the same results. Foe ex, OpenJDK, IBM JDK
Following steps explains how it works:-

 We create a program using program editor(eg. Notepad) and save it as


filename.java file in specified directory.
 Then we compile it using javac command(eg. javac filename.java), A java
compiler then convert .java file into .class file which is called as bytecode and this
bytecode is platform independent can run on different platforms eg.Windows,
Linux,MAC etc.

 If any bugs found during compilation that should be fixed first then compiled
again, If there is not any bugs found then bytecode is created and handed over to
JVM(java virtual machine) for interpretation.

 JVM interpret class file by running java space class name command(eg. java
filename) as given in figure.

 JVM has three components to interpret program first: Bytecode verifier which
verifies bytecode, second: Class loader which loads required classes from java
class library, third one is a JIT(just in time) compiler which compiles class file
and convert it into machine readable format and then hand over to operating
system.

 If there any bugs(mostly logical) found during interpretation(by JVM) then one
have to edit program to fix bugs and compile it again.If not any more bugs then
final output will be displayed on screen.

AIM:
Name of the Experiment:
1. Write a java program to find the simple interest.
HW/SW requirements:
Processor : AMD Athelon ™ 1.67 GHz
RAM : 256 MB
Hard Disk : 40 GB
JDK is required, With compilers.
Algorithm:
1. Start the program.

2. Declare the variables and assume values

3. InterestTopay=principle*time*rate/100;

4. print the values.

5. End of class and main method.

6. stop the process

Test Data:
a) Valid data sets: 25000 int value as principal, 12.5f float value as rate, 2.75 as double
as interestToPay
b) Limiting value sets: Only integer values can be stored in the var. principal.
c) Invalid data sets: If we assign float value in var. principal error will occur.
Results for different data sets:
Principalamount is Rs.25000 interest=Rs.8593.75
Total amount to pay to clear the loan = Rs.33593.75
Viva-Voc Questions :
1) What is a method? And What is OOPS?
2) What is the signature of a method?
3) What is the difference between an instance variable and a class variable?
4) What is an abstract method?
5) What is an abstract class?
6)What is an object reference

You might also like