Documente Academic
Documente Profesional
Documente Cultură
APPLICATION OF JAVA
Features of Java
• Simple
• Object-Oriented
• Portable
• Platform Independent
• Secured
• Robust
• High Performance
• Multithreaded
• Dynamic
Simple
Java is simple, it is easy to read and write.
Object-Oriented
Everything is an object in this world the same thing that applies to java programming.
Portable
Java is platform independent because it facilitates to carry the Java bytecode to any platform.
Platform Independent
Java is a platform independent because there are many platforms like Mac Os, Windows, and Linux.
Source Code cannot run in the different platform but when source code is converted into bytecode.
Bytecode can be run in a different platform. Simply we can say that the source code is platform
dependent and bytecode is platform independent.
Secured
Java is secured because there is no explicit pointer and java programs run in Virtual Machine. JVM
plays a role between the OS and Java Application.
Robust
• It uses strong memory management.
• Garbage collection is used to collect the unused objects.
• There is automatic garbage collection in java which runs on the Java Virtual Machine to get rid
of objects which are not being used by a Java application anymore.
High Performance
Java enabled High performance by introducing JIT- Just In Time compiler, JIT helps the
compiler to compile the code On demand basis i.e whichever method is called only that
method block will get compiled making compilation fast and time-efficient. This makes the
java delivering high performance.
• JIT - If we are calling one method for multiple times, one time that method is compiled and
multiple times reference are invoked.
Multi-threaded
The main purpose of multi-threading is to provide simultaneous execution of two or more parts of a
program to maximum utilize the CPU time.
Dynamic
Classes are loaded dynamically and automatic memory management (Garbage collection).
The Java Development Kit (JDK) is a software development environment used for developing Java
applications and applets.
• Use below link to download JDK/
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
• Based on your machine configuration download JDK.
• Install JDK-8u191-windows-x64.exe file.
• You will find a java folder where you installed your JDK on your machine.
JRE - Java Runtime Environment(to say JRE) is an installation package which provides environment
to only run(not develop) the java program(or application)onto your machine. JRE is only used by them
who only wants to run the Java Programs i.e. end users of your system.
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.
Versions of Eclipse
• Go to https://www.eclipse.org/downloads/packages/release/mars/2
• Download Mars 2 depends on your machine configuration.
• Extract this file eclipse-jee-mars-2-win32.
• Go to this folder structure eclipse-jee-mars-2-win32 → Eclipse → Launch Application.
• Choose a workspace where you want to save your projects.
• We have many features in eclipse and also we can create web application here.
CTRL + D
To delete a row.
CTRL+SHIFT+O
To Organize imports.
CTRL+SHIFT+T
CTRL+E
CTRL+F6
CTRL+F7
Move between views like package explorer, editor, task list, outline, problem, javadoc,
declaration,console,server.
CTRL+F8
Move between perspectives like Java EE, Debug, Java. The same as Ctrl+F7.
CTRL + F11
CTL + N
To create a new class, JSP, XML, or something else as much as in faster way.
CTRL + M
CTRL + I
Corrects indentation.
CTRL + SHIFT + F
Formats code. You can make a beautiful looking code out of a mess with this.
CTRL + SHIFT + L
CTRL+SHIFT+G
CTRL+SHIFT+/
To comment the lines.
CTRL+L
To find a line
CTRL + Q
To last edited place.
CTRL + F
To find the words.
3.Create two folders inside the test folder. Those names are like “Classes” and “Src”.
• Create a new folder name like “com” in Src folder.
• First go to the directory. Then compile the java code by using javac space filename.java.
• For the above code the class file is stored in same location as source code saved.
• After compilation if there is any error . It will show the number of errors. if not then we have to run
the program.
• Run the java program in command prompt by java space filename.
• The output will display.
• Here our example code output is “HELLOW JAVA”.
• Perform the java operations in ECLIPSE is more easier than command prompt.
• We can create java program only in class so we should follow some procedure below.
• To creating a new java program we can follow some steps.
• Open ECLIPSE tool , goto file menu click New.
• List of options are available. we select java project.
• Name the java project. Here we named as Hellow.
• Project name must start with captial letter or it should follow PASCAL.
• We can create n number of projects.
• Under each project we can create n number of packages.
• Every package may have number of clssses.
• Left side on desktop , under the package explorer the newly created project will display.
.
• The package name should be in small.
• Here we created a package names as "hello".
• Click finish option to create new package.
• Then create a class under specified package by right click on project , select class.
• Name the class. Here we named as "HelloWorld".
• Class name must start with captial letter or it should follow PASCAL.
• We have some basic options like modifiers , which method stubs would you like to create? etc..
• Choose any of those options based on requirement.
• Here we select main method option. so that it will create automatically.
• Click finish option to create new java class.
• Below slide show the new java class.