Click to edit Master title style
Introduction to JAVA
1
Click to edit
HISTORY Master title style
OF JAVA
James Gosling
started working on the Java programming language in June
1991 for utilization in one of his numerous set-top box ventures.
The programming language, at first, was called Oak.
This name was kept after an oak tree that remained outside
Gosling’s
office.
This name was changed to the name Green and later
renamed as Java, from a list of words, randomly picked from the
dictionary.
2 2
Click to edit Master title style
➢ Sun discharged the first open usage as Java 1.0 in
1995. It guaranteed Write Once, Run Anywhere
(WORA), giving no-expense run-times on prominent
stages. On 13 November 2006, Sun discharged much
of Java as free and open source under the terms of
the
➢ GNU General Public License (GPL). On 8 May 2007,
Sun completed the procedure, making the greater
part of Java’s center code free and open-source,
beside a little parcel of code to which Sun did not
h o l d t h e c o p yr i g h t .
3 3
Click to edit
FEATURES OFMaster
THE JAVA
titlePROGRAMMING
style LANGUAGE:
• Architecturally neutral.
That means that, unlike many other languages, you can use
Java to write a program that runs on any operating system (such
as Windows, Mac OS, or Linux) or device (such as PCs, phones,
and tablet computers).
• Java can be run on a wide variety of computers and devices
because it does not execute instructions on a computer directly.
Instead, Java runs on a hypothetical computer known as the Java
Virtual Machine (JVM).
4 4
Click to edit Machine
Java Virtual Master title style
(JVM).
5 5
Click to edit
FEATURES OFMaster titlePROGRAMMING
THE JAVA style LANGUAGE:
• Simple − Java is designed to be easy to learn. If you understand the basic
concept of OOP Java, it would be easy to master.
• Secure − With Java's secure feature it enables to develop virus-free, tamper-
free systems. Authentication techniques are based on public-key encryption.
• Portable − Being architecture-neutral and having no implementation
dependent aspects of the specification makes Java portable.
• Robust − Java makes an effort to eliminate error prone situations by
emphasizing mainly on compile time error checking and runtime checking.
6 6
Click to edit
Applications Master
of Java title style
Programming
The latest release of the Java Standard Edition is Java
SE 8. With the advancement of Java and its widespread
popularity, multiple configurations were built to suit
various types of platforms.
The new J2 versions were renamed as Java SE, Java EE, and Java
ME respectively. Java is guaranteed to be Write Once, Run
Anywhere.
Standard Edition or Java SE in version 1.5. The "SE" is used to distinguish the
base platform from the Enterprise Edition (Java EE) and Micro Edition (Java ME) platforms.
7 7
Click to editofMaster
Applications Java title style
Programming
• Multithreaded − With Java's multithreaded feature it is possible to write programs that
can perform many tasks simultaneously.
• Interpreted − Java byte code is translated on the fly to native machine instructions and
is not stored anywhere. The development process is more rapid and analytical since
the linking is an incremental and light-weight process.
• High Performance − With the use of Just-In-Time compilers, Java enables high
performance.
• Distributed − Java is designed for the distributed environment of the internet.
• Dynamic − Java is considered to be more dynamic than C or C++ since it is designed
to adapt to an evolving environment..
8 8
Click to
Local Environment
edit MasterSetup
title style
• Java SE is freely available from the link Download Java. You can
download a version based on your operating system
[Link]
Setting Up the Path for Windows
• Assuming you have installed Java in c:\Program Files\java\jdk directory −
• Right-click on 'My Computer' and select 'Properties'.
• Click the 'Environment variables' button under the 'Advanced' tab.
• Now, alter the 'Path' variable so that it also contains the path to the Java
executable. Example, if the path is currently set to
'C:\WINDOWS\SYSTEM32', then change your path to read
'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.
9 9
Click to Java
Popular edit Master
Editors title style
• To write your Java programs, you will need a text editor. There are
even more sophisticated IDEs available in the market. But for now,
you can consider one of the following −
• Notepad − On Windows machine, you can use any simple text editor like Notepad
(Recommended for this tutorial), TextPad.
• Netbeans − A Java IDE that is open-source and free which can be downloaded
from [Link]
• Eclipse − A Java IDE developed by the eclipse open-source community and can be
downloaded from [Link]
1010
Click -to
Java Basic
editSyntax
Master title style
• When we consider a Java program, it can be defined as a collection of
objects that communicate via invoking each other's methods.
• Object − Objects have states and behaviors.
• Class − A class can be defined as a template/blueprint that describes the
behavior/state that the object of its type supports.
• Methods − A method is basically a behavior. A class can contain many methods. It
is in methods where the logics are written, data is manipulated and all the actions
are executed.
• Instance Variables − Each object has its unique set of instance variables. An
object's state is created by the values assigned to these instance variables.
1111
ClickJava
First to edit
Program
Master title style
In order to start with basic basic Java programming, let us look at the standard Hello
World program.
public class MyFirstJavaProgram {
public static void main(String []args) {
[Link](“Say Hello World To The World!”);
}
}
1212
Click to edit Master title style
1313
Click to edit Master title style
1414
Click to edit Master title style
1515
Basic Syntax
•
Click to edit Master title style
About Java programs, it is very important to keep in mind the
following points.
Case Sensitivity − Java is case sensitive, which means identifier Hello and hello would
have different meaning in Java.
Class Names − For all class names the first letter should be in Upper Case. If several
words are used to form a name of the class, each inner word's first letter should be in
Upper Case.
Example: class MyFirstJavaClass
Method Names − All method names should start with a Lower Case letter. If several
words are used to form the name of the method, then each inner word's first letter should
be in Upper Case.
Example: public void myMethodName()
Filename –The name of the system record ought to precisely match the class name.
1616
Click to edit Master title style
Basic Syntax
• Program File Name − Name of the program file should
exactly match the class name.
• Example: Assume 'MyFirstJavaProgram' is the class name. Then the file
should be saved as '[Link]'
• public static void main(String args[]) − Java program processing starts
from the main() method which is a mandatory part of every Java program.
1717
Click to edit Master title style
Java object Oriented language
An object-oriented language
is a computer programming
language that revolves
around the concept of an
object.
The class is a blueprint
that defines a nature of a
future object. ...
1818
Click to edit Master title style
Object
-Vehicle
Class
-Pick car
Attributes
Method ()
-
1919
Click to editActivity
Laboratory Master 1title style
• Write your first java program that will output your:
• Firstname
• Lastname
• Middlename’
• Course Year & Section
• Address
• Age
• Gender
2020
Click to edit Master title style
THANK YOU..!!
2121
Click Identifiers
Java to edit Master title style
All Java components require names. Names used for classes, variables, and
methods are called identifiers.
In Java, there are several points to remember about identifiers. They are as follows −
• All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an
underscore (_).
• After the first character, identifiers can have any combination of characters.
• A key word cannot be used as an identifier.
• Most importantly, identifiers are case sensitive.
• Examples of legal identifiers: age, $salary, _value, __1_value.
• Examples of illegal identifiers: 123abc, -salary.
2222
Click to
Some Valid
editClass
Master
in Java
title style
2323
Click to
Some illegal
edit class
Masternames
title style
in Java
2424
Click Keywords
Java to edit Master title style
2525
Click to edit Master title style
Thank You…!!!
26