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

Ch1 Introduction to Java

This document provides an introduction to Java, highlighting its platform independence, extensive libraries, and features such as object-oriented programming, robustness, and security. It covers the history of Java, its differences from C++, and its applications in web development, including the use of applets. Additionally, it discusses Java's development tools, environment, and the Java Development Kit (JDK).

Uploaded by

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

Ch1 Introduction to Java

This document provides an introduction to Java, highlighting its platform independence, extensive libraries, and features such as object-oriented programming, robustness, and security. It covers the history of Java, its differences from C++, and its applications in web development, including the use of applets. Additionally, it discusses Java's development tools, environment, and the Java Development Kit (JDK).

Uploaded by

amanvarma9996
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

An Introduction to JAVA

Lecturer: Prof. Satishkumar Mulge


E-mail: [email protected]

Feb 10, 202


Introduction
 Java Platform means the environment which is used to run the
program.
 Java is Platform independent programming language since no only
single operating system can be required by the Java. All the different
operating system can execute the Java programming language.
 In the previous programming languages we have seen that most of the
programming part somewhat are not portable.
 The best example of this is if we use getch(), clrscr() in C or C++
programming of window then Linux do not allow for same.
 But comparatively Java provide good programming environment. All
code is portable.
 Java provide huge functionality that means it provides

A huge library

Containing lots of reusable code

An execution environment that provides services such as security

Portability across operating systems

Automatic garbage collection
2
Short History of Java
 Java is a general purpose, object oriented language developed by
Sun Microsystems of USA in 1991
 Java was originally called Oak (presumably because he liked the
look of an oak tree that was right outside his window at Sun) by
James Gosling.
 The Java team that included partrick Naughton discovered that
the existing languages like C and C++ had limitations in terms
of both reliability and portability.
 They modeled their new language Java on C and C++.
 Java is the first language which gives us facility of the
multithreading type of the programming.
 Java is the name of the hot drinks which is very popular in USA.
 All Java team like this hot drink very much, so they decided to
give name of this language as a java.
3
Features of Java
 Sun Microsystems officially describes java with the
following attributes, which made Java the first application
language of the World Wide Wed.
 Simple / Ease of Development
 Object Oriented
 Distributed
 Robust
 Secure
 Platform Independent
 Scalability and performance

4
Features of Java
 Desktop client
 Portable
 Interpreted
 High performance
 Multithreading
 Dynamic
 Monitoring and manageably
 JDBC Row Set

5
Features of Java
 Simple / Ease of Development
 Java does not use pointers, preprocessor header files,
goto statement, operating overloading and multiple
inheritance and many others --- so simple
 Object Oriented
 It include all features of OOPs
 Distributed
 Java is designed as a distributed language for creating
applications on Networks.
 Java applications can access remote objects on internet as
easily as they can do in a local system.
6
Features of Java
 Robust
 Java provides many safeguards to ensure reliable code.
 It does compile time and run time checking for data
types.
 It does garbage collection relieving the programming
virtually from all memory management problems.
 It also provides exception handing, which captures the
errors and eliminates any risk of crashing the system.

7
Features of Java
 Secure
 Java systems verify the memory access and also ensure that no
viruses are communicated with an applet.
 Absence of pointer in Java ensures that programs cannot gain
access to memory locations without proper authorizations.
 Platform Independent
 This is the most significant features of java.
 Java programs can be easily moved from anywhere at anytime.
 Change in operating systems and processors do not force any
changes in java programs . And so Java has become a popular
language for programming on Internet, which interconnects
different kinds of systems worldwide.

8
Features of Java
 Desktop client
 Java 2 provides enhanced features to meet the requirements of the
java desktop users. It provides an improved Swing look.
 Portable
 Java compiler generates byte code instructions that can be
implemented on any machine.
 The size of the primitive data types is machine independent.
 High performance
 Java performance is impressive due to the use of byte – code and
multithreading.
 JDBC Row Set
 This sends data in a tabular format between the remote
components of a distributed enterprise application. 9
How Java is different from c++
 Java is true object oriented language while C++ is basically
C with object – oriented extensions.
 Java does not supports operator overloading
 Java does not have template classes as in C++
 Java has replaced multiple inheritances of classes with a
new feature called interface
 Java does not use pointers
 Java has replaced the destructor function with a finalize()
function.
 There are no header files in java
 Java does not support global variables. Every variable and
method forms part of a class 10
How Java is different from c++
 Java does not support structures and unions
 All non primitive data types are created using new operator.
 Java adds a new right shift operator >>> which inserts zeros
at the top end.
 The modulo division may be applied to float values in Java
which is not permitted in C/C++.
 Java supports multithreading
 Java supports automatic garbage collection and makes a lot
of programming problems vanish.
 Java program do not use header files.

11
Java Applets and Internet
 What is Java Bytecode ?
 When the source code in the Java language is
complied, the Java ByteCode is created.
 It is highly optimized code which is interpreted by
JVM.
 The Java Virtual Machine is an abstract computer,
on which the byte code can execute.
 The Java Virtual Machine becomes a middle level
between the byte code and any operating system.

12
Java Applets and Internet
 Java programs that work on web pages are called Applets.
 An applets is ByteCode that can distributed through the
World Wide Web and used in Web page.
 We require Java – enabled web browser to execute the
bytecodes. Today, almost all web browser have come with
buit in java virtual Machine. And so the user who is surfing
the browser gets Java Virtual Machine by default.
 So, following are the benefits of Java and Internet which
comes together
 Use of more than one applet for web page
 Applets can communicate with each others

13
Java and World Wide Web
 Before java, the www was limited to the display of still
images and texts
 Incorporation of Java into web pages has made it capable of
supporting animation, graphics, games and many other
special effects.
 With the support of Java, web has become more interactive
and dynamic.
 The three common kind of java programs used on WWW
are the web browsers.
 HotJava
 Netscape Navigator
 Internet Explore
14
Java and World Wide Web
 HotJava
 It is the web browser developed by Sun Microsystems written entirely in
Java Language
 HotJava is available for Solaris Platform, Windows 95, Windows XP and
Windows NT
 HotJava is the first web browser to provide support for the java
language.
 Netscape Navigator
 It is the web browser developed by Netscape Communications
Corporation, is a general purpose browser that can run Java applets
 It is available for Solaris, Windows 95, NT and Applet Macintosh
 It provides features such as visual display of downloading process and
indication of number of bytes downloaded.
 Internet explorer
 It is the web browser developed by Microsoft for Windows 95, NT
and XP. 15
Java Support Systems
 Operations of Java and Java enable browsers on internet
require a variety of support systems for delivering
information on the Internet
Sr. No Support System Description
1 Internet Connection Local computer should be connected to
the Internet
2 Web Server Accepts request and sends the required
infromation
3 Web Browser Provides access to WWW and runs Java
Applets
4 HTML Creates hypertext for the web
5 Applet tag For placing Java applets in HTML
document
6 Java code Used for defining Java APPLETS

7 ByteCode Comiled Java Code 16


Java Enviroment
 This includes a large number of development tools and
hundreds of classes and methods.
 The development tools are part of JDK and classes and
methods are part of API (Application Programming
Interface)
 Java Development Kit (JDK)
 Tools in JDK are used for developing and running Java Programs.
 Application Programming Interface
 Java standard Library (or API) includes hundreds of classes and
methods grouped into several packages such as :

17
Java Development Tools
Sr. Tool Description
No
1 appletviewer Enables to view Java applets without actually using a java –
compatible browser

2 javac Java Compiler, which translates Java source code to byte codes
files that the interpreter can understand

3 java Java Interpreter, which runs applets and application by reading


and interpreting bytecodes files.

4 javap Java disassembler, which converts bytecode files into a program


description

5 javah Produces header files for use with native methods


6 javadoc Creates HTML documents from java source code files
7 jdb Java dedugger, which finds errors in our program
8 jar Create and manage Java Archive(JAR) files 18
Application Programming Interface
Package Description

1 Language Support Required for implementing basic features of Java


Package
import java.lang.*;
2 Utilities Package Provides utility functions such as date and time functions
import java.util.*;

3 Input / Output Required for input / output manipulations


package
import java.io.*;

4 Networking packages Enables to communicates with other computers via Internet


import java.net.*;

5 AWT package The Abstract Window Tool kit package contains classes that
import java.awt.*; implement platform independent GUI
6 Applet Package Includes a set of classes that allows to create Java applets 19
JAR files
 The JAR (java Archive) tool is a java application that
combines multiple files into single JAR archive file.
 JAR is a general – purpose archiving and compression tool,
based on ZIP and the ZLIB compression format.

20
Java Editors
 Editors are simple text files. They generally highlight the
Java Syntax, indent for you, balance your parentheses and
braces, and let you compile from within the editor.
 But they don’t write code.
 There are 4 types of editors for Java Programming :
 Multi - os editors

Emacs, Xemacs, JEdit
 Windows editors

TextPad, UltraEdit,notepad
 MacOS editors

BBEdit, SportCheck
 Unix/Linux editors

Emacs, Eemacs, JEdit
21
Questions:
 Java is pure object-oriented language Give one Reason
supporting the given argument
 What is javap?
 Why java is called as safer language compared to C++?
 What is jdb?
 Why jar is used in java?
 Why java needs compiler and interprester?
 What are java bytecodes?
 What does the java API cosist?
 What is JVM?

22
The End

23

You might also like