JAVA
Two major difference between Object Oriented Programming language and
Procedural Programming:-
Procedural programming paradigm aims more at procedures. The emphasis
is on doing things rather than the date being used. In procedural programming
paradigm, data are shared among all the functions participating thereby risking data
safety and security.
Object oriented programming paradigm is based on the principles of data
hiding, abstraction, inheritance and polymorphism. It implements programs using
classes and objects. In OOP paradigm, data and procedures, both are given equal
importance. Data and functions are encapsulated to ensure data safety and security.
Two features of OOP:
i) It gives stress on data items.
ii) The objects can be used as a bridge to have the data flow from one function to
another.
Object:
An object can be thought of as an entity having a specific identy, specific
characteristics and specific behaviour.
Why is an object called an instance of a class:
An object is called an instance of a class because it is based on the blueprint as
specified by the class and it actually reserves memory.
Abstraction/Data Abstraction:
Abstraction or Data Abstraction refers to the act of representing essential
features without including the background details or explanations.
Encapsulation:
The wrapping up of data and functions into a single unit is known as
Encapsulation.
Relation between Abstraction and Encapsulation:
Encapsulation is a way to implement data abstraction. Encapsulation hides
the details of the implementation of an object.
Data Hiding:
Data hiding is a related concept. When abstraction exposes the necessary or
required details it hides the rest of the details, which is data hiding.
Inheritance:
Inheritance is the capability of one class of things to inherit capabilities or
properties from another class.
1
- Baguiati
,Difference between Base class and Derive class:
A class which is used to derive another class during inheritance, is known as
base class.
A derive class acquires some properties from a base class.
Polymorphism:
Polymorphism is the ability for a message or data to be processed in more
than one form.
UNICODE
Unicode is a 2-byte character code set used for internal representation of characters
and strings. It uses 16 bits to represent each other.
How are objects implemented in software terms?
An object is implemented in software terms as follows:-
(i) Characteristics/attributes are implemented through member variables or data
items of the object.
(ii) Behaviour is implemented through member functions called methods.
(iii) Data and methods are encapsulated into one unit and given a unique name to
give it identity.
How do objects encapsulate state and behavior?
An object is an identifiable entity with some characteristics attributes and
behavior. The state of an object depends upon the values of its attributes at any
given point of time.
Since state and behavior of objects are interwoven, they are said to
encapsulate state and behaviour.
What are methods? How are these related to an object?
A method is an operation associated to an object. The behavior of an object is
represented through associated functions, which are called methods.
What is class? How are objects related to a class?
A class represents a set of objects that share common characteristics and
behaviour.
The abstraction represented by the class in the real sense.
Difference between an object and a class:
Class Object
1. A class represents a set of objects that 1. It is a unique entity having some
share common characteristics and characteristics and behaviours.
behaviour.
2. It is known as „Object Factory‟. 2. It is known as an „Instance of a Class‟.
3. Class is logical entity. 3. Object is actual entity.
2
- Baguiati
, Why class is called ‘Object Factory’?
Basically the class is an object maker or object factory. It contains all the
statements needed to create an object, its attributes, as well as the statements to
describe the operations that the object will be able to perform.
Java Byte Code:
It is a machine instruction for a java processor chip called java virtual
machine. The byte code is independent of the computer system it has to run upon.
Java API (Application Programming Interface):
Java API are libraries of compiled code that can be used in your programs It
consists of the functions and variables that programmers are allowed to use in their
applications.
How is ordinary compilation process different from Java compilation?
In ordinary compilation, the source code is converted to a machine code,
which is dependent upon the machine or the platform. This resultant machine code
is called native executable code.
Contrary to ordinary compilers, the Java compiler does not produce native
executable code for a particular machine. Instead it produces a special format called
byte code. The Java byte code looks a lot like machine language, but unlike machine
language Java byte code is exactly the same on every platform.
Importance of main( ) method:
A main function controls the execution of all the statements and functions to
produce the required output.
Characteristics of Java:
i) Write once Run anywhere (WORA).
ii) Light weight code.
iii) Security.
iv) Built-in-Graphics.
v) Object-Oriented Language.
vi) Supports Multimedia.
vii) Platform Independent.
viii) Open Product.
BlueJ
BlueJ is basically an IDE (Integrated Development Environment). It include
the following tools in it:
an editor, which you can use to write your programs.
a debugger, which helps you find your mistakes.
a viewer, which lets you see parts of your program graphically.
3
- Baguiati
Two major difference between Object Oriented Programming language and
Procedural Programming:-
Procedural programming paradigm aims more at procedures. The emphasis
is on doing things rather than the date being used. In procedural programming
paradigm, data are shared among all the functions participating thereby risking data
safety and security.
Object oriented programming paradigm is based on the principles of data
hiding, abstraction, inheritance and polymorphism. It implements programs using
classes and objects. In OOP paradigm, data and procedures, both are given equal
importance. Data and functions are encapsulated to ensure data safety and security.
Two features of OOP:
i) It gives stress on data items.
ii) The objects can be used as a bridge to have the data flow from one function to
another.
Object:
An object can be thought of as an entity having a specific identy, specific
characteristics and specific behaviour.
Why is an object called an instance of a class:
An object is called an instance of a class because it is based on the blueprint as
specified by the class and it actually reserves memory.
Abstraction/Data Abstraction:
Abstraction or Data Abstraction refers to the act of representing essential
features without including the background details or explanations.
Encapsulation:
The wrapping up of data and functions into a single unit is known as
Encapsulation.
Relation between Abstraction and Encapsulation:
Encapsulation is a way to implement data abstraction. Encapsulation hides
the details of the implementation of an object.
Data Hiding:
Data hiding is a related concept. When abstraction exposes the necessary or
required details it hides the rest of the details, which is data hiding.
Inheritance:
Inheritance is the capability of one class of things to inherit capabilities or
properties from another class.
1
- Baguiati
,Difference between Base class and Derive class:
A class which is used to derive another class during inheritance, is known as
base class.
A derive class acquires some properties from a base class.
Polymorphism:
Polymorphism is the ability for a message or data to be processed in more
than one form.
UNICODE
Unicode is a 2-byte character code set used for internal representation of characters
and strings. It uses 16 bits to represent each other.
How are objects implemented in software terms?
An object is implemented in software terms as follows:-
(i) Characteristics/attributes are implemented through member variables or data
items of the object.
(ii) Behaviour is implemented through member functions called methods.
(iii) Data and methods are encapsulated into one unit and given a unique name to
give it identity.
How do objects encapsulate state and behavior?
An object is an identifiable entity with some characteristics attributes and
behavior. The state of an object depends upon the values of its attributes at any
given point of time.
Since state and behavior of objects are interwoven, they are said to
encapsulate state and behaviour.
What are methods? How are these related to an object?
A method is an operation associated to an object. The behavior of an object is
represented through associated functions, which are called methods.
What is class? How are objects related to a class?
A class represents a set of objects that share common characteristics and
behaviour.
The abstraction represented by the class in the real sense.
Difference between an object and a class:
Class Object
1. A class represents a set of objects that 1. It is a unique entity having some
share common characteristics and characteristics and behaviours.
behaviour.
2. It is known as „Object Factory‟. 2. It is known as an „Instance of a Class‟.
3. Class is logical entity. 3. Object is actual entity.
2
- Baguiati
, Why class is called ‘Object Factory’?
Basically the class is an object maker or object factory. It contains all the
statements needed to create an object, its attributes, as well as the statements to
describe the operations that the object will be able to perform.
Java Byte Code:
It is a machine instruction for a java processor chip called java virtual
machine. The byte code is independent of the computer system it has to run upon.
Java API (Application Programming Interface):
Java API are libraries of compiled code that can be used in your programs It
consists of the functions and variables that programmers are allowed to use in their
applications.
How is ordinary compilation process different from Java compilation?
In ordinary compilation, the source code is converted to a machine code,
which is dependent upon the machine or the platform. This resultant machine code
is called native executable code.
Contrary to ordinary compilers, the Java compiler does not produce native
executable code for a particular machine. Instead it produces a special format called
byte code. The Java byte code looks a lot like machine language, but unlike machine
language Java byte code is exactly the same on every platform.
Importance of main( ) method:
A main function controls the execution of all the statements and functions to
produce the required output.
Characteristics of Java:
i) Write once Run anywhere (WORA).
ii) Light weight code.
iii) Security.
iv) Built-in-Graphics.
v) Object-Oriented Language.
vi) Supports Multimedia.
vii) Platform Independent.
viii) Open Product.
BlueJ
BlueJ is basically an IDE (Integrated Development Environment). It include
the following tools in it:
an editor, which you can use to write your programs.
a debugger, which helps you find your mistakes.
a viewer, which lets you see parts of your program graphically.
3
- Baguiati