Object Oriented Programming in Java - 1.1 - 1668501526533 PDF
Object Oriented Programming in Java - 1.1 - 1668501526533 PDF
and Java
Assist.Prof. S.B.Mehta
Computer Science and Engineer
Application Software
An application software is designed for benefit of users to perform one or more
tasks. Examples : of application software include Microsoft Word, Excel,
PowerPoint, Oracle, etc.
Hardware is a physical parts computer that cause Software is a set of instruction that tells a computer
processing of data. exactly what to do.
Hardware can not perform any task without software. software can not be executed without hardware.
As Hardware are physical electronic devices, we can We can see and also use the software but can’t actually
see and touch hardware. touch them.
It has four main categories: input device, output It is mainly divided into System software,
devices, storage, and internal components. Programming software and Application software.
Ex: Keyboard, Mouse, Monitor, Printer, CPU, Hard Ex: Ms Word, Excel, Power Point, Photoshop, MySQL
disk, RAM, ROM etc. etc.
Secondary Memory:
This memory is permanent in nature. It is used to store the different programs and the
information permanently (which were temporarily stored in RAM). It holds the
information till we erase it.
Different types of secondary storage devices are:
Hard Disc, Compact Disc, DVD, Pen Drive, Flash Drive, etc.
In procedural programming, program is divided into In object oriented programming, program is divided
small parts called functions. into small parts called objects.
There is no access specifier in procedural Object oriented programming have access specifier
programming. like private, public, protected etc.
Adding new data and function is not easy. Adding new data and function is easy.
Procedural programming does not have any proper Object oriented programming provides data hiding so
way for hiding data so it is less secure. it is more secure.
In procedural programming function is more important In object oriented programming,data is more important
than data. than Function
Procedural programming is based on unreal world. Object oriented programming is based on real world.
Examples: C, FORTRAN, Pascal, Basic etc Examples: C++, Java, Python, C#, smalltalk etc.
Presented by : Prof. S.B.Mehta
Object oriented Technology
• The Boolean data type specifies one bit of information, but its "size" can't be
defined precisely.
class Simple
{
public static void main(String args[])
{
System.out.println("Hello Java");
}
}
class Arith
{
public static void main(String args[])
{
int a=10,b=20, c;
c=a+b;
System.out.println(“Addition is :“ + c);
}
} save this file as Arith.java
For example: consider the following two equivalent statements assuming that
the
variable str holds the String "Java":
System.out.format("%.3f",34.789456);
// String input
String name = s.nextLine();
// Numerical input
int age = s.nextInt();
double salary = s.nextDouble();
// Output input by user
System.out.println("Name: "+ name);
System.out.println("Age: "+ age);
System.out.println("Salary: "+ salary);
}
}
import java.io.*;
public class BufferedReaderExample
{
public static void main(String args[])throws Exception
{
InputStreamReader r=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(r);
String name="";
System.out.println("Enter data: ");
name=br.readLine();
System.out.println("data is: "+name);
}
}