You are on page 1of 13

OBJECT ORIENTED

PROGRAMMING
TOPICS
1. INTRODUCTION 2. FUNDAMENTALS
TO OBJECT- OF THE JAVA 3. CLASSES AND
ORIENTED PROGRAMMING OBJECTS
PROGRAMMING LANGUAGE

5. MULTI-
4. INHERITANCE
THREADING AND
AND
EXCEPTION
POLYMORPHISM
HANDLING
TOPIC 2
FUNDAMENTALS OF THE
JAVA PROGRAMMING
LANGUAGE
Sub Topics

a. Java terminology and environment.


b. Programming style and
documentation in Java.
c. Java architecture components.
d. Programming Errors
Topic 2
Understand Java Terminology &
History of Java Technology
Environment
History of Java technology
• 1960s
Understand Java Features of Java programming language
Objects as aAnatomy
terminology–and of the in
formal concept Java programswere introduced in
programming
environment Simula 67, aProgramming
programmingstyle and designed
language documentation
for discrete event
simulation Write, compile and run java program
Errors in java
– created by Ole-Johan Dahl and Kristen Nygaard of the
Norwegian Computing Center in Oslo

Ole-Johan Kristen Kristen Ole-Johan


Dahl Nygaard Nygaard Dahl
Topic 2
Understand Java Terminology &
History of Java Technology
Environment
History of Java technology
• 1970s
Understand Java Features of Java programming language
terminology and Anatomy of the Java programs
– The Smalltalk language, which was developed at Xerox PARC (by
environment Programming style and documentation
Alan Kay and others) introduced the term object-oriented
Write, compile and run java program
programming to represent the pervasive use of objects and
Errors in java
messages as the basis for computation.

Alan Kay
Topic 2
Understand Java Terminology &
History of Java Technology
Environment
History of Java technology
• 1970s – 1980s
Understand Java Features of Java programming language
terminology and Anatomy of the Java programs
– Object-oriented features have been added to many existing
environment Programming style and documentation
languages during that time, including Ada, BASIC, Fortran, Pascal,
Write, compile and run java program
and others.
Errors in java
– Probably the most commercially important recent object-
oriented languages are Visual Basic.NET (VB.NET), C#, .NET
platform and Java.

• 1990s and above


– Object-oriented programming developed as the dominant
programming methodology when programming languages
supporting the techniques became widely available
Topic 2
Understand Java terminology and
History of Java technology
environment
Year Development History of Java technology
Understand Java Features of Java programming language
1990 Sun decided to developed special software that could be used for
terminology and Anatomy of the Java programs
electronic devices. A project called Green Project created and
environment Programming style and documentation
head by James Gosling.
Write, compile and run java program
1991 Explored possibility of using
Errors C++, with some updates announced a
in java
new language named “Oak”

1992 The team demonstrated the application of their new language to


control a list of home appliances using a hand held device.
1993-94 The World Wide Web appeared on the Internet and transformed the
text-based interface to a graphical rich environment.

1995 Sun Microsystems introduce “Java”

Java - The new programming


language developed by Sun
Microsystems
Topic 2
Understand Java terminology and
Features of Java Programming Language
environment
History of Java technology
Understand Java Features of Java programming language
terminology and Anatomy of the Java programs
environment Programming style and documentation
Write, compile and run java program
Errors in java

Explanation : http://www.javatpoint.com/features-of-java
Topic 2
Understand Java terminology and
Anatomy of the Java programs
environment
History of Java technology String[] args is used for command
Understand Features line argument.
of Java programming language
Comment Java Class name
terminology and Anatomy of the Java programs Class name
environment Programming style and documentation
Write, compile and run java program
//first Java Program
class Errors in java
class Simple{
public static void main(String args[]){
class System.out.println("Hello Java");
keyword is }
used to }
declare a
class in
java. public static void System.out.println

public static is a the return


Open file: is used to print statement
Simple.java. keyword is keyword, type of the
Compile and an access declare as method, no
run. modifier static return value
method
Topic 2
Understand Java terminology and
Programming style and documentation
environment
History of Java technology
Style
Understand Java Explanation
Features of Java programming language
terminology and
Comment Anatomy
Single of the Java
line comment : // programs
xxxxxxxxxxx
environment Programming
Block comment style : and
/*xxxdocumentation
Write, compile and run xxx */ program
java
Naming convention Errors in
Variables java
and method names: age , printDetails( )
Class names: Simple , Student
Constants: PI , DISCOUNT
Indentation Indent three spaces
Spacing Use blank line to separate segments of the code.
Block styles Next line
End of line
Topic 2
Understand Java terminology and
Java Architecture Components
environment
History of Java technology
Java can Java
• Understand run in manyFeatures
platform of Java programming language
terminology and Anatomy of the Java programs
Four component in architecture
• environment ProgrammingofstyleJavaand documentation
i. Java Source CodeWrite, compile and
- Program run java
written program
in the form of text using
Java. Errors in java

ii. Java Compiler - Used to convert source code into binary


program that consists of byte code. It creates .class file.
iii. Java Byte Code (Object Code) - Byte code is a set of
instructions that are machine-independent. Executed by
JVM.
iv. Java Virtual Machine (JVM) - Is a Java runtime system.
Converts the byte code in .class file to machine language.
Topic 2
Understand Java terminology and
Errors in java
environment
History of Java technology
Errors Features of Java programming language
Explanation
Understand Java
terminology and Anatomy of the Java programs
Syntax Errors mistakes made by a programmer in implementing the
environment
grammarProgramming style and documentation
of the Java programming language.
Write, compile and run java program
Errors in java
Runtime Errors error when program is executing
Logic Errors known as a semantic error.
Mistake could be the logical error in a statement (for
example, a wrong or incorrect formula), an error in
an algorithm, or even the wrong algorithm selected.

You might also like