Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
162 views

Module 1 - Java Introduction

This document provides an introduction to the Java programming language. It discusses that Java is an object-oriented language created by Sun Microsystems in the 1990s to be portable and used in a variety of devices. It then covers the history of Java, how it was influenced by other languages and designed to be platform independent. The document also outlines the main uses of Java today, including in mobile apps, web applications, and more. Finally, it introduces the "Hello World" program as a simple first program to demonstrate writing, compiling, and running a Java application.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Module 1 - Java Introduction

This document provides an introduction to the Java programming language. It discusses that Java is an object-oriented language created by Sun Microsystems in the 1990s to be portable and used in a variety of devices. It then covers the history of Java, how it was influenced by other languages and designed to be platform independent. The document also outlines the main uses of Java today, including in mobile apps, web applications, and more. Finally, it introduces the "Hello World" program as a simple first program to demonstrate writing, compiling, and running a Java application.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Module No.

1
What is Java? History and its Uses
Forms of Java
The Hello World Program
General Objective: To discuss and familiarize the learners with what is Java, the
history and its uses, the different forms of Java and to understand the Hello World
Program.
Topic No. 1.1 What is Java? History and its Uses
Forms of Java
The Hello World Program
Specific Objectives:
1. To discuss what is Java, the history and its uses and the different forms of Java.
2. To understand the Hello World Program which is the first step in Java Programming
Language.
Time Frame: 1 Hour
Learning Concept:
What is Java?
• Java is a high-level object-oriented programming language developed by the Sun
Microsystems. Though it is associated with the World Wide Web but it is older
than the origin of Web.
• It was only developed keeping in mind the consumer electronics and
communication equipments. It came into existence as a part of web application,
web services and a platform independent programming language in the 1990s.

History of Java
• Earlier, C++ was widely used to write object oriented programming languages,
however, it was not a platform independent and needed to be recompiled for
each different CPUs.

www. roseindia.com Page 1


• A team of Sun Microsystems including Patrick Naughton, Mike Sheridan in the
guidance of James Goslings decided to develop an advanced programming
language for the betterment of consumer electronic devices.
• They wanted to make it new software based on the power of networks that can
run on different application areas, such as computers and electronic devices.
• In the year 1991 they make platform independent software and named it Oak.
But later due to some patent conflicts, it was renamed as Java and in 1995 the
Java 1.0 was officially released to the world.
• Java is influenced by C, C++, Smalltalk and borrowed some advanced features
from some other languages.
• The company promoted this software product with a slogan named “Write
Once Run Anywhere” that means it can develop and run on any device
equipped with Java Virtual Machine (JVM).
• This language is applicable in all kinds of operating systems including Linux,
Windows, Solaris, and HP-UX etc.

Where Java is being used?


• Earlier, it was only used to design and program small computing devices but
later adopted as one of the platform independent programming language.
• The most important feature of Java is its byte code that can be interpreted on
any platform including windows, Linux etc. One can also download it freely from
the official website of Sun.
• Now it can be found in a variety of devices like cell phones, e-commerce
application, PCs and almost all network or computing devices.

Forms of Java:
1. JSP – Like PHP and ASP, Java Server Pages based on a code with normal
HTML tags, which helps in creating dynamic web pages.

www. roseindia.com Page 2


2. Java Applets – This is another type of Java program that used within a web
page to add many new features to a web browser. These are small program
used in the programming of instant messaging, chat service, solving some
complex calculation and for many other purposes.
3. JavaBeans – This is something like Visual Basic and a reusable software
component that can be easily assemble to create some new and advanced
application.
4. Mobile Java - Besides the above technology, Java is also used for various
entertainment devices especially mobile phone. Mobile Information Devices
Profile (MIDP) uses Java run time environment in cell phones, mobile tracking
systems and other traditional PDA devices.

• Java technology enabled application is key to the games and services available in
the mobile world.
• This also plays an important role in the field of telemedicine such as PulseMeter.
• As far as mobile technology is concerned, it offers offline facility, so that users
can get service even if they face loss of connection.

• Today, all leading mobile service provider like Nokia, Siemens, Vodafone are
using Java technology.

• The increase volume of users now encouraging manufactures and developers to


apply Java technology in numerous other productive and functional ways
including MP3 players, digital TV, video, 3D, simplifying games, etc.   

The Hello World Program


• Java application program is platform independent and can be run on any
operating System.
• Writing Hello World program is very simple.
• To write the Hello world program you need  simple text editor like note pad and 
jdk must be installed in your machine for compiling and running.

www. roseindia.com Page 3


• Hello world program is the first step of java programming  language.
• Be careful when you write the java code in your text pad because java is a case
sensitive programming language.

//hello world
public class HelloWorld {
       public static void main(String[] args){
       System.out.println("Hello World!");
     }
}

Understanding the Program


a. Class Declaration
public class HelloWorld { 
Class is the building block in Java, each and every methods & variable exists
within the class or object. (instance of program is called object ).
The public word specifies the accessibility of the class. The visibility of the class
or function can be public, private, etc.
b. The Main Method
The main method is the entry point in the Java program and java program can't
run without main method.
JVM calls the main method of the class. This method is always first thing that is
executed in a java program. Here is the main method:
public static void main(String[] args) {
c. The Curly Braces
{ and is used to start the beginning of main block and } ends the main block.
Everything in the main block is executed by the JVM.
d. System.out.println("Hello, World");
Prints the "Hello World" on the console. The above line calls the println method
of System.out class.

www. roseindia.com Page 4


e. The keyword static:

The keyword static indicates that the method is a class method,


which can be called without the requirement to instantiate an object of the class.
This is used by the Java interpreter to launch the program by invoking the main
method of the class identified in the command to start the program.

Style of Presenting the Lesson


Lectures will be given to students about what is Java, the history and its uses
and the different forms of Java Programming Language through PowerPoint slides
presentation then classroom discussion follows. An objective type of evaluation will be
given to the students after the discussion.

References:
www.roseindia.com

www. roseindia.com Page 5

You might also like