0% found this document useful (0 votes)
3 views19 pages

1-History of Java

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views19 pages

1-History of Java

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Subject Name : Java Programming

Subject Code: CSE208

CSE 208 Java Programming


09/22/2025 1
Course Objectives
 This course will help the learner to develop Java console applications using
packages, interfaces, classes, exception handling mechanism, and Collections
framework.
 The learner can also develop multi-threaded applications using Java thread
model. –execute more than one sequential set (thread) of instructions
 The learner will also be able to design GUI using Swing controls and event
handling mechanism.
 A graphical user interface (GUI) is a type of user interface through
which users interact with electronic devices via visual indicator representations.

CSE 208 Java Programming


09/22/2025 2
Syllabus
UNIT - I
Introduction: History and Evolution of Java - Overview of Java - Data types, Variables and
Arrays - Operators - Control Statements - Introducing Classes - A closer look at Methods and
Classes - Inheritance. Packages and Interfaces - Exception Handling

UNIT - II
Multithreaded Programming: Java Thread Model - The Main Thread - Creating a Thread -
Creating Multiple Threads - Thread Priorities - Synchronization. I/O: I/O Basics – Reading
Console Input - Writing Console Output. String Handling: String - String Buffer - String
Builder

UNIT - III
Collections Framework: Collection Interfaces - Collection, List, Set, Sorted Set – Collection
Classes - Array List, Hash Set, Tree Set - Accessing a collection via an Iterator - Working
with Maps - Comparators. Event Handling: Introduction - Event Delegation - Model - Event
classes - Sources of Events - Event Listener - Adapter Classes - Inner Classes in Event
Handling

UNIT - IV
Introducing GUI Programming with Swing: Introducing Swing - Exploring Swing – Introducing
Swing Menus
CSE 208 Java Programming
09/22/2025 3
Text Book

TEXTBOOK
1. Herbert Schildt, Java The Complete Reference, Tata McGraw Hill, Eleventh
Edition,2019.
REFERENCES
1. Harvey M. Deitel and Paul J. Deitel. JAVA: How to Program, Prentice Hall,
Ninth Edition,2012.
2. Kathy Sierra and Bert Bates. Head First Java, OReilly, Second Edition, 2009.
ONLINE MATERIAL
1. http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-092-
introduction-to-programming-in-java-january-iap-2010/lecture-notes/

CSE 208 Java Programming


09/22/2025 4
The History and Evolution of Java

CSE 208 Java Programming


51
• Computer language innovation and development occurs
for two fundamental reasons:

– To adapt to changing environments and uses


– To implement refinements and improvements in the art of
programming

• when a computer language is designed, trade-offs are often


made
– Ease-of-use versus power
– Safety versus efficiency
– Rigidity versus extensibility

CSE 208 Java Programming


62
Java’s Lineage
– FORTRAN Efficient but not suitable for system programs
– BASIC Easy but not powerful
– Assembly language Efficient but not easy to learn and debug
– BASIC, COBOL and FORTRAN were not designed around structured principles. Since they
use GOTO statements, the program is complex
– programs written using these languages tended to produce “spaghetti code”—a mass of
tangled jumps and conditional branches that make a program virtually impossible to
understand
– Pascal Structured but not efficient
– C Structured, efficient, high-level language that could replace assembly code when creating
systems programs.
– C++ OOP is a programming methodology that helps real world modeling through the use of
inheritance, encapsulation, and polymorphism.

CSE 208 Java Programming


7
– Binary machine instructions.
– Assembly language
– Unstructured High-level languages (FORTRAN)
– Structured high level languages (C)
– OOPS (C++)

–Java
platform-independent (that is, architecture neutral) language
 used to create software to be embedded in various consumer
electronic devices, such as microwave ovens and remote controls
 C or C++ are designed to be compiled for a specific target

 Design a C++ compiler for each architecture but its time as well as cost
consuming approach
 Java – concentrate on Internet programming

CSE 208 Java Programming


8
• Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank and
Mike Sheridan at Sun Microsystems
• This language was initially called “Oak,”-1991 renamed “Java” in 1995
• The C# Connection

– Created by Microsoft to support the .NET Framework,

– C# is closely related to Java. For example, both share the same general
syntax, support distributed programming, and utilize the same object model

CSE 208 Java Programming


9
How Java Changed the Internet
• Java innovated a new type of networked program called the applet

• An applet is a special kind of Java program that is designed to be transmitted over the Internet and
automatically executed by a Java-compatible web browser
• applet is downloaded on demand
– If the user clicks a link that contains an applet, the applet will be
automatically downloaded and run in the browser.
• In network, there are two broad categories of objects are transmitted between server and our
personal machine
– Passive objects (Email)
– Dynamic active programs (self executing programs) act as a active agent in client machine yet
it is initiated by server.
– applet is a dynamic, self-executing program.
• a normal program that downloads and executes automatically on the client
computer it may cause harm

• It can’t run in a variety of different environments and under different operating


systems.
CSE 208 Java Programming
- Java solved these problems in an effective and elegant way 10
• Security

– downloading a “normal” program, might contain a virus, Trojan horse, or


other harmful code
– that malicious code can cause its damage because it has gained
unauthorized access to system resources

– Java achieved this protection by confining an applet to the Java execution


environment and not allowing it access to other parts of the computer
• Portability

– the same applet can be executed by the wide variety of CPUs, operating
systems, and browsers connected to the Internet

CSE 208 Java Programming


11
• Java’s Magic: The Bytecode
– output of a Java compiler is not executable code. Rather, it is bytecode.
– Bytecode is a highly optimized set of instructions
– executed by the Java run-time system, which is called the Java Virtual Machine (JVM).
– JVM was designed as an interpreter(translate line by line) for bytecode.

– JVM will differ from platform to platform all understand the same Java bytecode
• Just-In-Time (JIT) compiler for bytecode
– JIT compiler is partof the JVM,
– selected portions of bytecode are compiled into executable code in real time, on a piece-
by-piece, demand basis

– It is important to understand that it is not practical to compile an entire Java program into
executable code all at once, because Java performs various run-time checks that can be
done only at run time
– Instead, a JIT compiler compiles code as it is needed, during execution
– not all sequences of bytecode are compiled—only those that will benefit from compilation
– The remaining code is simply interpreted. However, the just-in-time
approach still yields a significant performance boost
CSE 208 Java Programming
12
CSE 208 Java Programming
09/22/2025 13
CSE 208 Java Programming
09/22/2025 14
• Servlets: Java on the Server Side

– A servlet is a small program that executes on the server

– Servlets are used to create dynamically generated content that is then served to
the client

– For example, an online store might use a servlet to look up the price for an item
in a database. The price information is then used to dynamically
generate a web page that is sent to the browser

– Although dynamically generated content is available through mechanisms such


as CGI (Common Gateway Interface), the servlet offers several advantages,
including increased performance

– Because servlets (like all Java programs) are compiled into bytecode an
executed by the JVM, they are highly portable

– only requirements are that the server support the JVM and a servlet
container.
CSE 208 Java Programming
15
• Java Buzzwords
– Simple
– Secure
– Portable
– Object-oriented
– Robust
– Multithreaded
– Architecture-neutral
– Interpreted
– High performance
– Distributed
– Dynamic

CSE 208 Java Programming


16
• Simple
• experienced C++ programmer, moving to Java will require very little effort
• Because Java inherits the C/C++ syntax and many of the object- oriented
features of C++

• Object-Oriented
• Everything in java is an object

• Robust
• Strict compile time and run time checking
• in C/C++, the programmer will often manually allocate and free all
dynamic memory
• Here deallocation is completely automatic, because Java provides
garbage collection for unused objects
• Java provides object-oriented exception handling
• Multithreaded
– programs that do many things simultaneously
CSE 208 Java Programming
17
• Architecture-Neutral
• “write once; run anywhere, any time, forever.”

• Interpreted and High Performance


JVM and JIT

• Distributed
• Java is designed for the distributed environment of the Internet because
it handles TCP/IP protocols
• accessing a resource using a URL is not much different from
accessing a file
• Java also supports Remote Method Invocation (RMI). This feature
enables a program to invoke methods across a network

• Dynamic
• Dynamically linking new class libraries ,methods, object
CSE 208 Java Programming
18
Thank you

You might also like