Subject - Computer Application
Subject - Computer Application
Pop is a Procedural Oriented Programming Language. In this, the stress is laid on function rather than data.
Data may be keep floating throughout the Programming .Hence by scanning the whole program from beginning
to the end and we can rectify any error caused.
Drawbacks of POP:-
1) As Data values are global to all the functions, you may require to make necessary changes in the functions
due to change in the data values.
Characteristics of POP:-
OOP is an Object Oriented Programming Language. It is a modular approach , which allows the data be applied
within the stipulated program area. It also provides reusability features to develop productivity logic.
Features of OOP:-
3) The objects can be used as a bridge to have data flow from one function to another.
Encapsulation-Binding up of data and function together into a single unit called (class) is called Encapsulation.
Data Abstraction-Act of representing only essential features without including its background details is called
Abstraction.
Attribute:-The characteristics which make every object having its identity make them distinguished is called
attribute.
Polymorphism:-The ability of a method to behave in more than one form is called polymorphism. Function
Overloading is a way to implement it.
Inheritance:- The ability of a class to opt the properties from base or another class is called Inheritance. Extends
is a way to implement it.
Advantages of OOP:-
Data binding- is the process to link to the function call with function signature at run-time i.e., during execution of
a program.
Data Hiding:-is the data which cannot be accessed directly outside, class premises although they are available in
the same program
1) Standalone Application:- An application program that is developed by the user is called standalone
application.
2) Internet Applets:-These are the java programs that are executed in a web browser.
Java Virtual machine is a processor chip that uses byte code as machine instruction and converts it into
machine code.
Byte code is a set of pseudo machine language instructions that are understood by the JVM and are independent
of the underlying hardware.
Application Programming Interface (API):-consists of libraries of pure compiled code that programmers can
use in their application.
Java. Lang:- It is a default class containing String, character, Math, Integer, thread etc. It is a Basic suntime
support.
4) Built in graphics.
5) Supports multimedia
6) Platform Independent
Keywords are the reserved words which convey a special meaning to a language compiler.
Comments (Remarks):- refers to statements which are ignored by the java compiler and increase the readability
of a program. These are used to state a purpose of the instructions used in a program.
A token are a smallest individual character used in a java program and is a fundamental unit of a
program. It consists of a keywords, identifiers, operators etc.
Literal (Constant):-are the fixed variables which do not change its values during progam execution.
Operator- are the entities that tells the compiler that what operation has to be perform compiler n given sets of
value.
Data types- are the entities that tell the compiler that which variable will hold what kind of values.
Operands- are the entities that tell the compiler that on which operation has to be perform.
Primitive data types:-Independent of any data type .Also called as Basic Data type. They are pre defined or built
in data types because they are already in java.e,g. byte,int,long,double etc.
Non Primitive Data Types:-Directly or indirectly dependent on primitive data types. They store the data values
with reference to the address or locations. So, they are called as Reference Data Types.
Variables:-is a named memory location in which we can store our desire data.
Identifiers: - is a series of characters consisting of letters, digits, underscores (_) and dollar signs ($) that does not
begin with digit or special character , should not be a keywords and do not contain any space.
Type conversion:-When an expression holds different types of variables or constant, they are converted to the
same type.
Implicit Data Type:-Such Type of conversion is performed by the compiler without programmer’s intervention. It
occurs when an expression holds different types of variables or constants.
Explicit data type: - Such Type of conversion is user defined conversion which forces an expression to be
converted into specific type.
5) Math.log ()-always returns a double data type. And returns natural logarithmic values.
8) Math,round()-returns the value in rounded form. Always returns an int data type. If the fractional part of the
number is below 0.5 it returns a number down to the nearest integer otherwise returns the next integer
value.
9) Math.floor()-it returns a number don to a nearest integer. and always returns a double data type.
10) Math.ceil()-provided the rounded value to a next higher integer. returns a double data type.
Import is a pre defined keyword by which we can include all pre defined classes, packages and function in a
program.
Exception refers to any contradictory or unusual situation which can be encountered during a progam execution.
3) Processing exceptions for widely used components that should not process their own exceptions.
Stream Is a flow of data in the form of bytes and provides capabilities of processing all types of data.
Packages are group of related classes and interfaced and provides a convenient mechanism for managing a large
sets of classes and interfaces and avoiding naming conflicts.
FUNCTIONS
Static Data members is an instant variable which is global in the class and commonly by all the objects of that
class type.
Static member method is a member method which uses only static data members or static instant variable.
Function Signature refers to the name of function and different types of arguments (parameters)in the function
prototype.
Return is a java keyword used as the last statement of the method if it returns a valid java data type.
Actual Parameters are parameters specified while calling the method whose value is passed to the method.
Formal parameters are parameters which are specified in the function prototype.
Pure function is that function which returns values and do not change their state.
Impure function is that function which may returns values but change their state.It is also known as Modifier
functions.
Void keyword indicates that the function does not return any values.
Function overloading means when more than one functions have same name but the types and number of the
arguments are different .
A method is given a private access if its scope is to be limited to the class in which it is defined. The other classes
will not be able to invoke the private method of other classes.
Main() is the first method that gets called in a java class (progam).The keywords static makes the java
interpreter call main method without the need of creating any object .
All non-static methods can be called only by writing object name and method name separated by a
dot.
If a method or member variable is preceeded by protected access specifier, the scope of the member is the
class itself (where it is declared) and its sub-class i.e., these members can be inherited unlike the private
members.
1) Static methods can only call other static methods without associated with objects.
2) Static methods can only access other static data without associated with objects
Pass by value is the process of passing a copy of actual arguments to the formal parameters. Any change
made in the formal parameters does not reflect on the actual arguments.
Pass by Reference is the process of passing the reference (address) of actual arguments to the formal
parameters. Any change made in the formal parameters reflect on the actual arguments.
1) Computational Functions that calculate or compute some value and return calculated value.
2) Manipulative functions that manipulate information and return success or failure code.
Function overloading helps in avoiding the use of if-else statements to decide which function should
be called in which context as in case of overloading functions the compiler automatically takes the
decision, based upon the parameters used to call the functions.
CONSTRUCTORS
Constructor is that unit of a class which is used to initialize the data members.
Characteristics of Constructor:-
7) Non Parameterized do not accept any argument and initialize data members by legal initial
value.
8) Parameterized accept argument and initialize data members by value of the arguments
passed.
Constructor overloading:-Defining more than one constructor or a class with different number for type of
parameters passed to a constructor.
Destructor is a member method that gets invoked when the object scopes ends. The memory allocated to objects
by the constructors gets deallocated when a destructor gets invoked automatically. A destructor’s name is same
as that of a class name. A destructor does not return any value not even void. A class can have only one destructor.
In java, the new operator allocates the memory for the objects during the run-time of a program. The
memory occupied by these objects is deallocated when no references to the objects exist. This
memory can be reclaimed. In java, this deallocation is performed automatically and is called the
garbage collection feature.
A Default constructor is invoked by default by the system. It initializes the instant variable of an object with
defined values.
A Copy Constructor initializes the instant variables of an object by copying the initial values of the instant
variables from another object.
A Parameterized Constructor is a member function with same name as that class name which is used initializes
the object variables by passing parametric values at the time of its creation.
General Glossary
2) Break Statement-It is a statement, which is used to terminate the program, when the condition is
satisfied.
3) Buffer –is a high speed temporary storage, which is also known as cache memory
4) Character-It is a token which is a distinctive mark or symbol, alphabets (small or capital ) or digits.
5) Compiler-The software which converts high level language instructions to machine level language at
once.
6) Compound Statement-Is a set of multiple statement written within braces {}is called a compound
statement.
7) Continue Statement-is a statement which is used to go for the next iteration, when the condition is
satisfied within the program.
8) Debugging-is the process of correcting errors which occurs during the compilation of the program.
9) Dynamic Binding is the process of linking the function call with the function signature during the
execution if the program.
10) Instant Variables –A variable defined within the class or object.
11) Scope of variable-It is a parameter of variables within which they can be applied in a program.
12) Reusability-The process of adding some additional features to a class without modifying its
contents.
14) Object factory-A producer of objects that accepts some basic information and creates objects on
based on this information.
15) Final –It is a keyword which before variable make it constant. (imp.)
17) Block- It is a group of zero or more statements between balanced braces and can be used anywhere
a single statement is allowed.
18) Static- It is a keyword which in the variable declaration make it class variable.
19) New-It is a keyword which allocates the memory and instantiate an object.
20) Type Promotion-Conversion of all operands upto all the type of the largest operands.
21) Integral Promotion- -Conversion of shorter integral types into bigger integral types.
22) Java shorthand-A way of combining an arithmetic operator and an assignment operator.
23) This-It is a keyword (which is actually a reference) sorting the address of the objects currently
invoking a member functions.
24) Accessor method-It is a method that returns the value of a data-member of the class.It is actually
for Private members.
25) A Setter method-(Mutator method) –It is a method that sets \changes the value of a data-
member of the class.It is actually for Private members.
27) Try and catch- Try contains a block of statements to perform any error occurring within the try
block is trapped. Further a report is passed to the exception handler about the error, which is done by
the catch block.
28) Super –It is a keyword used in inheritance for calling base class constructor.
29) Throws-It is a keyword used to inform that an error has occurred. It is specified with method
prototype.
31) Compile time error-Error that the compile can find during compilation.
34) Fall-through- The misuse or missing of break statement leads to fall of control.
38) Selection Statement-Statement that allows to choose a set-of-Instruction for execution depending
upon an expression.
44) Nested Loop-A loop that contains another loop inside its body.
45) Piece-of-code (Variable’s scope)-The program part(s) in which a particular piece-of code or a data
value (e.g., variable) can be accessed.
47) Sequential construct-The Statements in a program are executed sequentially one after the other
from to the last statement.
48) Non- Static variables- It can be accessed in static members by associating them with object separated
by a dot.
49) Continue Statement-This statement changes the flow of execution to stop the sequential execution
and resume the condition check.
50) Library class-Pre defined classes of java which get included in an application program itself. They are
also known as Standard java classes or built-in-java classes.
51) Byte stream classes- They are built up to provide the functionality of reading and writing bytes. They
help in transmitting data (bytes) in one direction. They are thus useful in Input-Output operation.
53) Reader class- is a Character stream classes i.e., it is used to read characters from source.
56) Subscripts are cell numbers of the array &subscript variable is the variable used along with
cell no. E.g., m[4] 4 =Subscript m= subscript variable.
57) Buffered reader- It buffers the input and improves the performance.
61) Coercion-Implicit data type conversion is termed as coercion in which the data gets converted to its
higher type without any intervention of user.
62) Parameter- The variable used with method signature which received value during function call.
63) Arguments-The values which are passed to the method during its call from the caller.
64) Object source- The conversion of High Level Language to Machine Level Language with the help of a
translator.
65) Source code-An application program written High Level Language, which is an input to a computer
system.
66) Static initialization- When a variable is initialized with a specific constant before its use in the
operation.
67) Testing-It is the process of checking program logic manually to ensure whether it contains any error or
not.
68) Normal flow of control- When a command to execute a program is issued, control keeps on moving
sequentially from one statement to other from beginning to an end in order to execute them is known as
normal flow of control.
69) String Buffer-It is a type of memory location, which allows reasonable space to contain a string in such
a way that any change brought affects the same string.
70) Multilevel Inheritance- A target which inherits a base can be used as a base for another target.
71) Class members declared to be protected are treated as private members for the existing
class but can be inherited to another class.
GIVE REASONS
Ans:-It contains all the statements needed to create an object, its attributes as well as the statements to describe
the operations that object will able to perform.
2) An object as an instance of class.
Ans:-Data members of a class are also referred as Instance variables. These Instance variables are embedded
automatically within an object at the time of its object creation.
Ans:-A class is a construct that binds one or more primitive types together to be used as a single data types. It is
designed by the programmer and thus, it is called user defined data types.
Ans:-Every object has its own attributes and function. Nokia cellphone has its characteristics of memory ,no of
tones ,it is its attributes and has functions like send and receives call ,games etc.
Ans:-The programs written in this language are closer to the objects that are effected by the program. In java,
even a simple program to display a message needs to be a class defined in which a method are written.
Ans: - It concentrates on the real word objects and is portable which demand by World Wide Web.
Ans: - In java, the new operator allocates the memory for the objects during the run time of a program. The
memory occupied by these objects is deallocated when no reference to the objects exist. In java, this deallocation
is performed automatically.
9) An object’s state and behavior are two distinct things yet linked to one another.
Ans: - The state of an object controls its behavior of an object can bring about a change in its state.
Ans: -Encapsulation is a way to implement data abstraction. Encapsulation hides the details of the implementation
of an object.
11) Only a function that has access to the constructor can use the objects of this class.
Ans: - Since, every time an object is created, it is automatically initialized by the constructor of a class.
Ans: - Platform is the environment in which programs execute instead of interaction with the OS directly, java
program run on a virtual machine provided by java.
Ans: -JVM being software produces machine readable code from byte code. Hence, it is referred as machine.
31 31
63 63
A data type starts with lower case letters and its wrapper class begin with upper case letters.
String type allocates fixed length in the memory but the string buffer type allocates memory with
length by the user. Accessor Method is also known as pure function. Mutator Method is also known
as impure function.