Introduction to JAVA
What is Java?
Java is an object oriented programming language originally developed by
Sun Microsystems and released in 1995.
Java programs are platform independent which means they can be run
on any operating systems with any type
Constructor in java is a special type of method that is used to initialize the object. Java constructor is
invoked at the time of object creation. It constructs the values i.e. provides data for the object that is
why it is known as construct
Object - Objects have states and behaviors. Example: A dog has states - color,
name, breed as well as behaviors -wagging, barking, eating. An object is an
instance of a class.
Class - A class can be defined as a template/blue print that describes the
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
COURSE #: CSE 205
SEMESTER : FALL 2016
COURSE TITLE : OBJECT ORIENTED PROGRAMMING
LECTURE C LASSES : SUNDAY & T UESDAY
LECTURER : NADIA BINTE ASIF
#OFFICE ROOM: 6007
Java Modifiers & Variables
Java has two type modifiers for variables, classes and methods:1. Access Modifier
2. Non Access Modifier
Access Control Modifier
There are four access control modifier in Java:1.
Scope only inside the package. (default)
Purpose of Constructors
Constructors are used to initialize the instances of your classes. You use
a constructor to create new objects often with parameters specifying the
initial state or other important information about the object
Purpose: A class cont