Professional Documents
Culture Documents
Java Lec1
Java Lec1
BIT
Faculty of Electrical and Computer engineering
Department of computer engineering
Outline
o What is computer?
o What is object oriented programming?
o Why java?
o The Java Language Specification, API, JDK,
and IDE
o Designing Good Programs (SE life cycle)
o Object oriented fundamentals
OOP Interpreted By: Asaminew G. 10/25/2017 3
What is computer ?
An electronic device that stores and processes
data.
Works under the control of a computer program,
a set of instructions that tell a computer what to
do
Includes both hardware and software
Hardware is the physical (electronic and mechanical
components) aspect of the computer that can be seen
Software is the invisible instructions that control
the hardware and make it perform specific tasks.
…
It .
use a period ( ) to separate each package structure
Syntax :-
package [package name]
import [other-Package]
[modifier (optional)] Class [class-Name] {
modifier fields-Name ;
Constructor method (optional)
normal method
}
OOP Interpreted By: Asaminew G. 10/25/2017 30
Fields and Data type
Field :-
is a variable or data associated with programs such as
string, integer, array and object
also called instance variable (fields)
names should be in mixed case
Represent state of an object
are a place where information can be stored while a
program is running
their value can be changed at any point in the program
Data type :-
isexpress a type of fields
E.g. string, integer, float, Boolean,…
List of fields
e.g. name, age, sex,…
List of methods
getName()
setName(“Abel”)
…
…
…