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
The basic version of quick sort algorithm was invented by C. A. R. Hoare in 1960
and formally introduced quick sort in 1962. It is used on the principle of divide-andconquer. Quick sort is an algorithm of choice in many situations because it is
Introduction to Trees
Tree represents nodes connected by edges. It is used to represent hierarchical
data. So the required definition of tree shall be Tree is collection of entities
called nodes linked together to simulate hierarchical data.
Tree is a non
INFIX, POSTFIX, PREFIX
Operand: Objects in which operations are performed.
Infix notation: X + Y
Operators are written in-between their operands. This is the usual way
we write expressions. An expression such as A * ( B + C ) / D is usually
taken to mean
INTRODUCTION TO STACK
What is stack?
In computer science, a stack is an abstract data type that serves as a collection of elements, with two
principal operations: push, which adds an element to the collection, and pop, which removes the most
What if the input to binary search tree comes in sorted (ascending or descending) manner? It will
then look like this
It is observed that BST's worst-case performance closes to linear search algorithms, that is (n).
In real time data we cannot predict da
CIRCULAR LINKED LIST
Circular Linked List is a variation of Linked list in which first element points to last element and last
element points to first element. Both Singly Linked List and Doubly Linked List can be made into as
circular linked list.