0% found this document useful (0 votes)
3 views

Chapter 1 II Introduction to Java Theory

Java, developed by Sun Microsystems in 1991, is a simple, object-oriented, platform-independent programming language known for its security and robustness. It compiles source code into bytecode, which is then interpreted by the Java Virtual Machine (JVM) to run on any platform. Java supports applets for web applications and standalone applications, and it includes a rich set of libraries and reserved keywords for programming.

Uploaded by

Agam Stories
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Chapter 1 II Introduction to Java Theory

Java, developed by Sun Microsystems in 1991, is a simple, object-oriented, platform-independent programming language known for its security and robustness. It compiles source code into bytecode, which is then interpreted by the Java Virtual Machine (JVM) to run on any platform. Java supports applets for web applications and standalone applications, and it includes a rich set of libraries and reserved keywords for programming.

Uploaded by

Agam Stories
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

INTRODUCTION TO JAVA

Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank
and Mike Sheridan, in the year of 1991, in the Broomfield, Colorado (USA) by Sun
Microsystem.
In 1991, at Sun Microsystems, Green team led by James Gosling started working on a
new technology for consumer electronic devices. Over the next 18 months, in 1992 the
team created a new programming language which they called “Oak”, by the James
Gosling after an Oak tree outside his window at Sun. Oak was renamed to Java and
on 23rd of May 1995, Sun microsystems made its first public release.
Compile Interpreted by JVM

Java Program------------------> Byte Code ------------------> Machine Code


(Source Code)

CHARACTERISTICS OF JAVA :-

Page | 1
UMESH COMPUTER KENDRA (PH: 9897188951}
1. Simple: - Java is a simple easy to learn language. The removal of many
unreliable features of C and C++, and simplified its understanding and
implementation.
2. Object Oriented: - Java is a pure object-oriented programming language
because it treats everything as an object. Even the most elementary program
has a class.
3. Platform Independent: - The concept of “Write Once, run anywhere”, is
one of the most powerful features of java, which make it a very powerful
language. Java application can run on any platform that has the JVM installed
on it.
4. Secure: - Java is secure because it allows Applets to confine to the java
runtime environment only. Applets cannot be accessing any other part of the
computer when downloaded on the web browser.

Page | 2
UMESH COMPUTER KENDRA (PH: 9897188951}
5. Robust: - Java is a robust and reliable programming language. Its powerful
compiler checks for early errors during compilation and interpreter checks for
any runtime errors.
6. Multithreaded: - Multithreaded is a ability of an application to perform
multiple task simultaneously.
7. Java programs are both compiled and interpreted.
8. It can access data form from a local system as well as from the net.
9. Java programming is written within a class. The variables and functions
are declared and defined in the class.
10. Java is a case sensitive, the upper case and lower-case letters are
distinguished by the language.

Compiler and Interpreter

Page | 3
UMESH COMPUTER KENDRA (PH: 9897188951}
Compiler Interpreter
It converts the whole source program It converts the source program into the object
into the object program at once. program, one line at a time.
It displays the errors for the whole It displays the error one line at a time and only
program together, after the after fixing that error the control goes to the next
compilation. line.

JAVA APPLETS AND APPLICATIONS: - Java can be used two type of programs:
Applets and Applications.
Applets: - An applet is a program written in java programming language.
Applets are used for internet programming. Applets can be used in webpages.
Applets cannot run directly on a user’s machine but need a web browser.

Page | 4
UMESH COMPUTER KENDRA (PH: 9897188951}
Applications: - An application is a standalone program (like any other
application created in C/C++) which run independently on a computer. Java
standalone applications can either be console-based or a Graphic-based.
1. Console-Based java application use a text-only interface. Ex: cmd.exe
2. Graphic-Based java application uses a graphical interface. Ex: Window
calculator.

BYTE CODE: - Java Compiler converts source code to an intermediate code.


This code helps generate machine code. This code is independent of the
machine on which the program runs. It makes a java program highly portable.
Thus, this intermediate code is known as ‘Byte Code’.

JAVA VERTUAL MACHINE: - Java Interpreter converts byte code into machine
code. The byte code is the general binary form of the java source code. This
Page | 5
UMESH COMPUTER KENDRA (PH: 9897188951}
binary form needs to be modulated according to the machine on which it is
to be executed. Java interpreter plays an important role acting as a machine
to produce object code compatible to the specific machine. Java interprater
is still referred as the Java Virtual Machine (JVM).

JAVA DEVELOPMENT KIT (JDK): - It is a software package from Sun


microsystems which contains the development tools needed to integrated
and execute applets and applications.
JAVA LIBRARIES: - Java package is a collection of various classes. Each class
contains different functions. In case you want to use a specific function of a
class within your program, then the package containing the function needs to
be included in your program. A package can be included in the program by
using b keyword ‘import’. Java.lang is the default package of java
programming.
Page | 6
UMESH COMPUTER KENDRA (PH: 9897188951}
Some useful packages in the java class library are given below:
(1) java.lang: It is used to support classes contain String, Character, Math
functions etc.
(2) java.io: it is used to support class to deal with input and output statement.
(3) Java.util: it is used to support Scanner and Printwriter classes.
(4) java.applet: It is used to support class to deal with applets.
(5) java.net: It is used to support class to deal with network.
(6) java.awt: It is used to support graphic user interface.
(7) java.txt:- It is used to support text elements.
JAVA RESERVED WORDS: - Java reserved words or the keywords are those
words which carry special meaning to the system compiler. These words are
basically used for writing a java statement in the program. Such words cannot
be used for naming a variable in the program. Ex. for, switch, break, float,
byte, if, public, class, default, do, long, void, import, new, case etc.
Page | 7
UMESH COMPUTER KENDRA (PH: 9897188951}
INTRODUCTION TO BLUEJ: - The development for BlueJ was started in 1999
by Michael Kolling and John Rosenberg at Monash University in Melbourne,
Australia. BlueJ is currently being maintained by a joint team at the university
of Kent at Canterbury (England) and Deakin University in Melbourne
(Australia).

FEATURES OF BLUEJ: -
1. The compilation and execution of program is comparatively easier.
2. It provides window approach.
3. It provides a sample program in window after making a class.
4. It highlights the error in the lower pane of window.
5. It can be used with the latest version of java.
6. It displays a graphical representation of the class in the program.
Page | 8
UMESH COMPUTER KENDRA (PH: 9897188951}
OUTPUT STATEMENT IN JAVA PROGRAMMING: - The statement which is
used to get the output of the program or to display messages on the screen,
is given as:
System.out.println();
e.g. System.out.println(“Welcome to Java Programming”);
It displays the message in same line and place the cursor in the next line, i.e.
next successive output take place in next line.
e.g. System.out.print(“Welcome to Java Programming”);
It displays the message in same line and place the cursor in the same line, i.e.
next successive output take place in the same line.

Page | 9
UMESH COMPUTER KENDRA (PH: 9897188951}
COMMENTS: - Comments are the remark from the programmer to describe
the operation of the program to anyone who is reading its source code.
Comments line are ignored by the compiler.
Java supports three type of comments:
1. Single line comments: A single line comments begins with a double
forward slash (//) and ends with the end of the line.
2. Multiline comments: This type of comment begins with forward slach
followed by an asterisk sign (/*) and ends with an asterisk sign followed by
the forward slash (*/). It is used for more than one-line comments.
3. Documentation Comments: This type of comment begins with forward
slash followed by double asterisk sign (/**) and end with the asterisk
followed by a forward slash (*/).

Page | 10
UMESH COMPUTER KENDRA (PH: 9897188951}

You might also like