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

ACP_Lecture_01_Java_Introduction

ACP_Lecture_01_Java_Introduction

Uploaded by

gk0563546
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)
2 views

ACP_Lecture_01_Java_Introduction

ACP_Lecture_01_Java_Introduction

Uploaded by

gk0563546
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/ 49

Advance Computer Programming

By
Usama Imtiaz
About Me

Lecturer (SE&CS)
Ph.D. In progress (FAST-NU)
AI Consultant (Aim Lab FAST NU)
MSCS (FAST NU)
BSCS (COMSATS)
Lecture Outlines
 Computer Programs and Programming Languages
 Programming Language Paradigms
 Introduction to Java
 Why Java
 History of Java Language
 Java’s Future
 Java’s Features
 Java Code Compiling Process
 Types of Java Applications
 The Java Language Specifications
 Java Application Programming Interface (API)
 The Java Development Kit (JDK)
 Java Development Tools (or IDEs)
 Summary
Computer Programs

 Computer programs known as software, are instructions


to the computer

 You tell a computer what to do through programs.


Computers do not understand human languages, so you
need to use computer languages to communicate with
them

 Programs are written using programming languages


Programming Language

 A programming language is an artificial language


designed to communicate instructions to a machine,
particularly a computer

 Programming languages can be used to create programs


that control the behavior of a machine and/or to express
algorithms precisely
Programming Language Paradigm

Programming Paradigms

Imperative Declarative

Procedural Modular Logic Functional

Structured Domain-Specific

Object-Oriented
Java - Introduction

 Java is the general purpose programming language


 Java is the Internet Programming Language
 Java can be used to develop applications i.e.
 Desktop Applications, Java Applets
 Web applications Java Servlets and Java Server Pages
(JSP)
 Applications for hand-held devices such as palm
and cell phones
Why Java Language?
History of Java Language

Who Develops Java?

The Java language was developed at Sun Microsystems in


1991 as part of a research project to develop software for
consumer electronics devices.
Java’s Creator

Java is a programming language and


environment whose original name was Oak
and developed as a part of the Green
project at Sun started by James Gosling.
Java’s Initial Goal

 Java’s goals at that time were to be small, fast,


efficient, and easily portable to a wide range of
hardware devices.

 It is those same goals that made Java an ideal


language for distributing executable programs via
the World Wide Web.

“Write once, run anywhere!”


Java’s Features
Features of Java

 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple • Java is partially modeled on C++, but greatly


 Java Is Object-Oriented simplified and improved. Some people refer to

 Java Is Distributed Java as "C++--" because it is like C++ but with


more functionality and fewer negative aspects
 Java Is Interpreted • Memory management is automatic
 Java Is Robust • No pointers
 Java Is
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple • Java is inherently object-oriented. Although

 Java Is Object-Oriented many object-oriented languages began


strictly as procedural languages, Java was
 Java Is Distributed designed from the start to be object-

 Java Is Interpreted oriented.

 Java Is Robust • One of the central issues in software

 Java Is Secure development is how to reuse code. Object-


oriented programming provides great
 Java Is Architecture-Neutral flexibility, modularity, clarity, and reusability

 Java Is Portable
through encapsulation, inheritance, and
polymorphism.
 Java's Performance • Encapsulation
 Java Is Multithreaded • Inheritance

 Java Is Dynamic • Polymorphism


Features of Java

 Java Is Simple Distributed computing involves several


computers working together on a
 Java Is Object-Oriented network.
 Java Is Distributed Java is designed to make distributed
 Java Is Interpreted computing easy. Since networking
 Java Is Robust capability is inherently integrated into
Java, writing network programs is like
 Java Is Secure sending and receiving data to and from
 Java Is Architecture-Neutral a file.

 Java Is Portable RMI(Remote Method Invocation)

 Java's Performance CORBA

 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple You need an interpreter to run Java


 Java Is Object-Oriented programs. The programs are compiled
into the Java Virtual Machine code
 Java Is Distributed called bytecode.
 Java Is Interpreted The bytecode is machine-independent
 Java Is Robust and can run on any machine that has
 Java Is Secure a Java interpreter, which is part of the
 Java Is Architecture-Neutral Java Virtual Machine (JVM).

 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java
Java has eliminated certain types of error-
 Java Is Simple prone programming constructs found in
other languages.
 Java Is Object-Oriented
 Java Is Distributed Java has a runtime exception-handling
 Java Is Interpreted feature to provide programming support
for robustness.
 Java Is Robust
 Java Is Secure No error-prone constructs

 Java Is Architecture-Neutral Efficient Exception handling

 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed Automatic null checking of references

 Java Is Interpreted Verification of type casting


Automatic array bound checking Use
 Java Is Robust of Final Classes
 Java Is Secure Security Manager

 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java
Write once, run anywhere
 Java Is Simple
 Java Is Object-Oriented With a Java Virtual Machine (JVM), you

 Java Is Distributed can write one program that will run on


any platform.
 Java Is Interpreted
 Java Is Robust Byte code
OS independent
 Java Is
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-Neutral
 Java Is Portable Because Java is architecture neutral, Java
programs are portable.
 Java Is Multithreaded Java programs can be run on any
 Java Is Dynamic platform without being recompiled.
Features of Java

 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance Byte code includes compiling information
Interpreter interprets byte code quickly
 Java Is Multithreaded
 Java Is Dynamic
Features of Java

 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-NeutralMultithread programming is smoothly
 Java Is Portable integrated in Java, whereas in other
languages you have to call procedures
specific to the operating system to enable
 Java's Performance multithreading.
 Java Is Multithreaded
 Java Is Dynamic Parallel task Data
sharing
Features of Java
Java was designed to adapt to an evolving
 Java Is Simple environment. New code can be loaded on the

 Java Is Object-Oriented fly without recompilation. There is no need for


developers to create, and for users to install,
 Java Is Distributed major new software versions. New features can

 Java Is Interpreted be incorporated transparently as needed.

 Java Is Robust Extended class lib

 Java Is Secure Multiple inheritance based on Interface

 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
Summary of Java’s Features
Compiling C++ Source Code

A program written in a high-level language is called a


source program. Since a computer cannot understand a
source program. Program called a compiler is used to
translate the source program into a machine language
program called an object program. The object program is
often then linked with other supporting library code
before the object can be executed on the machine.
Compiling Java Source Code
 Nowadays computers are networked to work together.
 Java was designed to run object programs on any platform.
 With Java, you write the program once, and compile the source program
into a special type of object code, known as bytecode.
 The bytecode can then run on any computer with a Java Virtual Machine
(JVM), as shown below.

 JVM is a software that interprets Java bytecode.


Creating, Compiling, and Running JAVA Programs

Create/Modify Source C o d e

So u rc e c o d e (d ev elo p ed b y the p ro g ra m m e r)
Sa v e d o n the disk
public class Wel co me {
public static void main(String[] args)
{ System.out.println("Welcome to Source C o d e
Java!");
}
}

Co mpile Source C o d e
B y t e c o d e (generated b y the compiler for J V M
i.e., javac Welcome.java
to read an d interpret, not for y o u to
understand)

Method Welco me() If co mp il ati o n errors
0 aload_0 stored o n the disk

B ytecode
Method void main(java.lang.String[])
0 getstatic # 2 …
3 ldc # 3 <String "We l c o me to
Java!">
5 invokevirtual # 4 …
8 return R u n Byteode
i.e., java We l c o me

R e su lt

If ru n ti me errors o r incorrect result


Platform-Independence

Other Language Java Platform


Types of Java Applications
In general, two types of applications
 Normal/Desktop applications
 Web-based Applications
 Java Desktop Application
– Run on local computer
– Based on J2SE
 Java Applet
– Run on web browser
– Based on J2SE
 Java Servlet
– Run on application server
– Based on J2EE
 Enterprise JavaBeans
– Run on application server
– Based on J2EE
- JAVA Language Specification

- JAVA API (Application Programming Interface)

- JAVA Editions

- JDK (Java Development Kit)

- JAVA IDE (Integrated Development Environment)


Java’s Language Specification

The Java language specification is a technical definition


of the language that includes the syntax and semantics
of the Java programming language. The complete Java
language specification can be found at

java.sun.com/docs/books/jls
Java API – Application Programming Interface

The application program interface (API) contains predefined classes


and interfaces for developing Java programs. The Java language
specification is stable, but the API is still expanding.
At the Sun Java Website (java.sun.com), you can view and download
the latest version of the Java API.
http://docs.oracle.com/javase/8/docs/index.html
Java’s Edition

Java is a full-fledged and powerful language that can be used in many


ways. It comes in three editions:
 Java Standard Edition (Java SE)
Java SE can be used to develop client-side standalone applications or applets
 Java Enterprise Edition (Java EE)
Java EE can be used to develop server-side applications, such as Java servlets and
Java Server Pages
 Java Micro Edition (Java ME)
Java ME can be used to develop applications for mobile devices, such as cell
phones.
Integrated Development Environments (IDEs)

 An integrated development environment (IDE) is a


software application that provides comprehensive
facilities to computer programmers for software
development.

 An IDE normally consists of:


 a source code editor
 a debugger

 Some IDEs contain compiler, interpreter, or both,


such as Microsoft Visual Studio and Eclipse
Integrated Development Environments (IDEs)

 Besides JDK, you can use a Java development tool (e.g., Net-
Beans, Eclipse, and TextPad) — Software that provides an
integrated development environment (IDE) for rapidly
developing Java programs.

 Editing, compiling, building, debugging, and online help are


integrated in one graphical user interface. Just enter source
code in one window or open an existing file in a window, then
click a button, menu item, or function key to compile and run
the program.
JBuilder
Oracle JDeveloper
IntelliJIDEA
BEA Weblogic
Eclipse

• Eclipse Platform
• http://www.eclipse.org/platform
• Developed by the Apache Software Foundation
NetBeans
JCreator
Notepad and Textpad
Java Communities

http://www.javaworld.com

http://docs.oracle.com/javase/tutorial/
Java Home
• http://java.sun.com
• http://www.java.com
• http://www.oracle.com/technetwork/java/index.html
Java Supported Companies
Summary

 Introduction of Java
 Brief history of Java
 Features/characteristics of Java
 Java compilation Process
 Types of Java Applications
 Java Development Kit
 Java Editions
 Java Development Tools

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy