0% found this document useful (0 votes)
263 views

ICSE Mind Maps & On Tips Notes Class 10 - Computer Applications

The document discusses key concepts in object-oriented programming including classes, objects, encapsulation, inheritance, and polymorphism. It also covers Java programming concepts such as data types, variables, operators, and control flow statements like loops.

Uploaded by

ks.ashwini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
263 views

ICSE Mind Maps & On Tips Notes Class 10 - Computer Applications

The document discusses key concepts in object-oriented programming including classes, objects, encapsulation, inheritance, and polymorphism. It also covers Java programming concepts such as data types, variables, operators, and control flow statements like loops.

Uploaded by

ks.ashwini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ON TIPS

NOTES
Note making is a skill that we use in many walks of life : at school, university and in the world of
work. However, accurate note making requires a thorough understanding of concepts. We, at Oswaal,
have tried to encapsulate all the chapters from the given syllabus into the following ON TIPS NOTES.
These notes will not only facilitate better understanding of concepts, but will also ensure that each
and every concept is taken up and every chapter is covered in totality. So go ahead and use these
to your advantage... go get the OSWAAL ADVANTAGE!!

CHAPTER 1 : Revision of Class-IX Syllabus


 In Object Oriented Programming, the data and its methods are enclosed in a class by encapsulation.
 The basic concepts of OOP include Data Abstraction, Encapsulation, Inheritance, Polymorphism,
Classes, Objects & Dynamic Binding.
 Java is an Object-Oriented Programming Language, thus, Java supports the following fundamental
concepts of an Object Oriented Programming:
l Polymorphism: Ability of an object to take on many forms.
l Inheritance: A mechanism in which one object acquires all the properties and behaviours of parent

class.
l Encapsulation: A process of wrapping code and data together into a single unit i.e., class.
l Abstraction: Process of hiding the implementation details from the user.
 Object: An object is a unique entity, which contains data & functions together. Example: A dog has
states - colour, name, breed as well as behaviours like - wagging the tail, barking, eating, etc. An object
is an instance of a class.
 Class: A class can be defined as a template or blueprint that describes the behaviour/state that the
objects of its type support class is the factory to create objects.
 Instance: An object is an instance of a class.
 Method: A method is a collection of statements that are grouped together to perform the specified task.
 Local variables: Variables defined inside methods, constructors or blocks are called local variables. The
variable will be declared and initialized within the method and the variable will be destroyed when the
method has completed.
 Instance variables: Instance variables are variables within a class but outside any method. These
variables are initialized when the class is instantiated. Instance variables can be accessed from inside
any method, constructor or blocks of that particular class.
 Class variables: Class variables are variables declared within a class, outside any method, with the static
keyword. Unlike instance variables, we can have only one copy of a static variable per class, irrespective
of how many objects we create.
 Operators in Java: The various types of operators and their use are:
l Arithmetic Operators:
v Unary operators: Act on one operand
t Unary + The result is the value of the argument.
t Unary - The result is the negation of the argument.
v Binary operators: Act on two operands
t Additional operator + To add two values.
t Subtraction operator - To subtract two values.
t Multiplication operator * To multiply two values.
t Division operator / To divide two values.
t Modulus operator % To find remainder after dividing two numbers.
v Increment/Decrement operators:
t ++ To increase value of operand by 1
6 OSWAAL ICSE Combined Sample Question Papers for Semester-I, COMPUTER APPLICATIONS, Class-X
t - - To decrease value of operand by 1
l Relational Operators:
v < Less than
v <= Less than or equal to
v > Greater than
v >= Greater than or equal to
v == Equal to
v != Not equal to
l Logical Operator
v && To check truth of both the conditions, acts as boolean AND
v || To check truth of either of the conditions, acts as boolean OR
v ! To check falseness of a condition, acts as boolean NOT
v ^ To check whether the two conditions are different
l Assignment Operators
v = To assign one value to another
 Library Methods
Library methods in Java include various in-built functions. Some of them are :
l abs( ): To find absolute value of an argument.
Syntax: public static datatype abs(argument)
l floor( ): To find the greatest integer which is less than the given argument.
Syntax: public static datatype floor(argument)
l ceil( ): To find the lowest integer which is greater than the given argument.
Syntax: public static datatype ceil(argument)
l pow( ): To find value of one argument raised to the power of the other argument.
Syntax: public static datatype pow(argument1, argument2)
l signum( ): To find sign (+ or -) of the given argument.
Syntax: public static datatype signum(argument)
l round( ): To round off an argument to the nearest decimal.
Syntax: public static datatype round(argument)
 Iteration statements are statements (or compound statements) to be executed zero or more times,
subject to some loop-termination criteria. When these statements are compound statements, they are
executed in order, except when either the break statement or the continue statement is encountered.
 Loops are basically meant to do a task multiple times, without actually coding all statements over and
over again. For example, loops can be used for displaying a string many times, for counting numbers and
of course for displaying menus.
 Loops in Java are mainly of three types :
l ‘while’ loop : A while statement executes its statements as long as a specified condition evaluates to

true.
Syntax : While (condition)
{statements}
l The
 ‘do-while’ loop : It is very similar to the ‘while’ loop shown above. The only difference being,
in a ‘while’ loop is that the condition is checked before the body of loop, but in a ‘do-while’ loop,
the condition is checked after one execution of the loop.
Syntax : do
{statements}
while (condition);
On Tips Notes 7
l The
 ‘for’ loop : This is probably the most useful and the most used loop in Java The syntax is
slightly more complicated than that of ‘while’ or the ‘do-while’ loop.
Syntax : for (<initial value>;<condition>;control variable update)
{statements}
 The Break Statement : Use the break statement to terminate a loop, switch, or in conjunction with a
labelled statement.
(i) When you use break without a label, it terminates the innermost enclosing while, do-while, for, or
switch immediately and transfers control to the following statement.
(ii) When you use break with a label, it terminates the specified labelled statement.
The syntax of the break statement looks like this :
break; [Label]
 The Continue Statement : The continue statement can be used to restart a while, do-while, for or label
statement.
(i) When you use continue without a label, it terminates the current iteration of the innermost enclosing
while, do-while, or for statement and continues execution of the loop with the next iteration. In
contrast to the break statement, continue does not terminate the execution of the loop entirely. In a
while loop, it jumps back to the condition. In a for loop, it jumps to the increment-expression.
(ii) When you use continue with a label, it applies to the looping statement identified with that label.
The syntax of the Continue statement looks like the following :
continue [Label];

CHAPTER 2: Class as the Basis of all Computations


 There are two datatypes available in Java :
l Primitive Datatypes
l Reference/Object Datatypes
 Primitive Datatypes : There are eight primitive datatypes supported by Java. Primitive datatypes are
pre-defined by the language and named by a keyword.
l byte
l short
l int
l long
l float
l double
l boolean
l char
 Reference Datatypes
l Reference variables are created using defined constructors of the classes. They are used to access

objects.
l These variables are declared to be of a specific type that cannot be changed. For example, Employee,

Puppy, etc.
l Class objects and various types of array variables come under reference data-type.
l Default value of any reference variable is null.
l A reference variable can be used to refer any object of the declared type or any compatible type.
 A variable can be declared as
<datatype> <variable_name>
 An object variable can be declared as
<class_name> <object_name>
 A class is a composite and user-defined datatype.
 In Java, all functionalities are closed in classes.
 When class is used as user-defined data type, it should not include main method in it.
 When a class is to be used as an application, then it should include main method in it.
 Object is the instance of a class.
 Objects are created using the new operator along with the class constructor.
 The real-life objects like cars, dogs, etc. have both state (colour, gears, breed, name, etc.) and behaviour
(speed, ignition, halting, barking, running, smelling, etc.).
8 OSWAAL ICSE Combined Sample Question Papers for Semester-I, COMPUTER APPLICATIONS, Class-X

 Software objects also have state and behaviour. Their state is maintained by variables and behaviour is
implemented through methods.
 In an object,
l There are variables to hold data called member variables or attributes.
l The values of these member variables define the state of an object.
l There are member methods / operations / messages that define the behaviour of objects.
 Once a class is declared, the variables of this class type (objects) can be declared and created. So, class
can be considered as an object factory.
 Class provides a blueprint for objects. From this blueprint, objects are created using the new operator.
 The keyword this refers to a current object which is created and initialised automatically by Java.

CHAPTER 3: User-Defined Methods


 Method: A program module used simultaneously at different instances in the program is called method
or function.
 Need of methods:
l To allow us to handle complex problems.
l To hide low-level details that otherwise are ambiguous and confuse.
l To reuse portions of code without retyping it.
 Syntax of methods:
<Access specifier> <Return type> <method name> (parameter list)
{• //Body of the method•}
(i) Access specifier – public or private.
(ii) Method declared without access specifier is by default treated as public
(iii) Type- Specifies the data of the value returned from the method
(iv) Method name – Preferably related to the program
(v) Parameter list – Variables which receives the value passed from the arguments during method call
 The components of a method are:
l Header (Function Prototype) : First line which contains Access Specifier, Return Type & Function
Signature (i.e., Function_Name(ParameterList))
l Method Block : contains set of statements to perform.
 Header public int add() {Program Body; return(value);}. The statement which sends back the value
from a method is called program return statement and is used at the end of the program which is a
function terminator.
 Different ways of defining a method:
l Receiving value and returning outcome to the caller.
l Receiving values but not returning outcome to the caller and vice versa.
l Neither receiving values nor returning outcome to the caller.
 A method is invoked or called by providing the method name followed by the parameters to be sent
enclosed in parenthesis. Any static method needs to an object to call the method.
For example, a method with prototype as float peri(float l, float b) can be called in the main program as:
res = obj.peri(l,b), where obj is an object of the class.
 Formal parameter:
l Parameter is a variable used with method signature that receives a value during method call.
l When the parameter values are received from the caller, then it is called formal parameter.
 Actual Parameter: If the values are passed to the method during its call from the caller, then it is actual
parameter.
 Ways to invoke methods: A method is invoked by two methods call by value or call by method depending
upon the ways the arguments are passed to the methods.
 Call by Value :
l Process of passing a copy of actual arguments to the formal parameters.
l Any change made in the formal will not reflect on actual argument.
 Call by Reference:
l Process of passing the reference of actual arguments to the formal parameters and any change in

the formal parameters will be reflected in the actual parameters also.
 A method terminates when either a return statement is encountered or last statement in the method is
executed.
 A method may contain several return statements but only one of them gets executed.
On Tips Notes 9
 The method of type void does not return a value and thus it cannot be used in expressions.
 Forms of methods:
l Pure method, also called accessor.
l Impure method, also called mutator.
 Pure method or Accessor takes objects as arguments but does not modify the state of the objects.
 Impure method or mutator takes objects on as argument and changes the state of the objects.
 Method overloading:
l Method with the same name but different parameter list, i.e., difference in no., order or type of
parameters. It is used for different purposes is called as overloaded methods.
l It is implemented through polymorphism.
l Compiler finds the best match of the method arguments and the parameter list during program
compilation called static binding.

CHAPTER 4: Constructors
 A constructor is a special type of method of a class which is used to initialize a newly created instance
of the class, eg- 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 constructor.
 The two rules to defined a constructor are:-
l Constructor name must be same as its class name.
l Constructor must have no explicit return type.
 Characteristics of Java Constructors
l Constructors name must be exactly same as that of its class name.
l Constructors are called automatically when an object is created.
l Constructors cannot be private.
l A constructor can be overloaded.
l Constructors cannot return a value.
l Constructors do not have a return type (not even void).
l Constructors are not members of the class. Thus, they cannot be inherited.
 The main use of Constructors is to initialise the object of that class type with a legal initial value.
 Types of Java Constructors: There are following types of constructors:-
l Default constructor (no-argument constructor)
l Parameterised constructor
 The parameterised constructors are used to initialise fields of the class with some specific values.
 In Constructor overloading, the number of parameters can be same but it can also have different data types.
 Compiler differentiates constructors on the basis of number of parameters, types of parameters and
order of parameters.
qqq

You might also like