Types of Java Applications: Cs8383 Object Oriented Programming Laboratory
Types of Java Applications: Cs8383 Object Oriented Programming Laboratory
19
class Simple
{
public static void main(String args[])
{
System.out.println("Hello Java");
}
}
1) Standalone Application
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.
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.
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.
4) JavaFX
It is used to develop rich internet applications. It uses a light-weight user interface API.
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.
JDK=JRE+development tools
JDK is an implementation of any one of the below given Java Platforms released by Oracle
Corporation:
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)
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:-
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.
3. InterestTopay=principle*time*rate/100;
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