Computer Notes
Computer Notes
Define
1) Class – Class is a group of objects that have some common attributes and behaviour
Eg. Fruit is a class and orange is an object that belongs to it.
2) Object – An object is an identifiable entity with some attributes and behaviour.
3) Abstraction – Abstraction refers to the act of representing essential features without
including background details.
Eg. ATM Machine
4) Encapsulation – Encapsulation is a mechanism that binds data and code together into
one unit. It keeps them safe from the outside world, preventing any unauthorised access.
5) Inheritance – Inheritance is a powerful mechanism by which one class acquires the
properties of another class.
6) Polymorphism – Polymorphism refers to the ability of an object to take different
forms.
7) Constants – These are values that remain fixed and do not change in the program.
8) Variables – Variables represent reserved memory locations containing data values.
9) IDE – IDE is a software suite with programming facilities like GUI builder, code
editor, compiler, interpreter and debugger used by software developers through a
graphical user interface. Eg BlueJ is an IDE for Java.
10) Token – Java tokens are the basic building blocks of a Java program. They are the
smallest unit of a java program.
They are of 5 types:
● Keyword
● Identifiers
● Literals
● Operators
● Separators
11) Keywords – Keywords also called Reserved Words, are the words that have a special
meaning to Java compilers. Eg if, int
12) Identifiers – Identifiers are used to name different components of a program such as
variables, methods,etc. Two rules for writing identifiers are :
● An identifier cannot begin with digit
● Java is case sensitive, which means that two identifier names that differ only in
upper and lower case characters are considered to be different identifiers.
13) Literals – Literals are the values stored in variables. Literals are made of digits,
letters and other characters.
14) Separators : Separators in a programming language are used to separate program
elements from one another.Example: semicolon
15)Data type – Data types represent the type of value stored by a variable. They are of
two types.
● Primitive data type – They are simple, predefined data types supported by Java.
There are eight primitive data types . For example:int,float
● Non Primitive data type – The data types that are derived from primitive data
are called non primitive data types. They are also called reference data types.
For example:Array and Class
16) Procedure-oriented programming language follows a top-down approach in
execution. A group of instructions is organised into functions that can be reused. Data is
accessed by functions.
17) An object-oriented programming language follows a bottom up approach and is
based on the concept of objects. Objects are small segments of code that contain
functions to perform a task on a given data. Eg C++ and Java .
Types Size
Byte 8 bits
Short 16 bits
Int 32 bits
Long 64 bits
Float :32 bits
Double:64 bits
char :16 bits
Operator Symbol
Equal to ==
Not equal to !=
Operator Symbol
Logical OR ||
Logical NOT !
Associativity – If two operators have the same precedence they are either evaluated
from "left to right" or from "right to left" this term as associate which tells the
direction of execution of operators when operators in an expression have the same
precedence.