java lec 1
java lec 1
BIT
Faculty of Electrical and Computer engineering
Department of computer engineering
Outline
o What is object oriented
programming?
o Development environment
o Object oriented
fundamentals
OOP Interpreted By: Asaminew G. 12/03/2024 3
What is object oriented
programming?
Is a programming deals with a
collection of interacting objects
An object can be: -
a physical thing, such as a Car
a mental thing, such as an Idea.
a natural thing, such as an Animal
an artificial thing, such as an ATM.
OOP Interpreted By: Asaminew G. 12/03/2024 4
cont. …
Java was created in 1991 by
James Gosling of Sun
Microsystems.
Initially called Oak, latter it was
changed to Java because there
was already a language called
Oak.
OOP Interpreted By: Asaminew G. 12/03/2024 5
API, JDK and IDE
API (Application programming interface) is a
class library
Contains predefined classes and interfaces in a
package
The Java language specification is stable, but the
API is still expanding
API->package->class, interface, exception, etc.
JDK (Java Development toolkit) consists of a set
of separate programs for developing and testing
Java programs, each of which is invoked from a
command line
OOP Interpreted By: Asaminew G. 12/03/2024 6
Cont.
JDK (Java Development Kit) contains the API
as well as the compilers, runtimes, and other
miscellaneous tools. The Java API is simply all
the libraries that make up the core language
that you can work with out of the box.
IDE (Integrated Development Environment) is a
software Editing, compiling, building, debugging, and
online help are integrated in one graphical user
interface
OOP Interpreted By: Asaminew G. 12/03/2024 7
OOP fundamentals
1. Feature of OOP
Portable :- running on different platform
(window, Linux, Mac, Solaris). Java is
different from other programming language
because, it both compiled and interpreted. A
file with .class extension is contain a byte
code. Byte code is machine language of the
java virtual machine ( java VM). Java include
a set of class library that provide basic data
type, system input and output capability.
OOP Interpreted By: Asaminew G. 12/03/2024 8
Feature of OOP cont…
…
OOP
.
It use a period ( ) to separate each package structure
Interpreted By: Asaminew G. 12/03/2024 12
Indentation and comment
List of fields
e.g. name, age, sex,…
List of methods
getName()
setName(“Abel”)
…
…
…