Saturday 21 December 2013

INHERITANCE

Inheritance 
Inheritance is the process of forming a new class from an existing class or base class.
The base class is also known as parent class or super class, the new class that is formed is called derived class.
Derived class is also known as a child class or sub class. Inheritance helps in reducing the overall code size of the program, which is an important concept in object-oriented programming.
It is classifieds into different types, they are


Ø Single level inheritance : In single level inheritance, there is only one base class and has only one derived class.   

                
Example of single level inheritance:
class Base
{

};

class Derv: public Base
{
     };
                           
      

Ø Multi-level inheritance : In multi level inheritance, there will be a chain of inheritance with a class derived from only one parent and will have only one child class.   

 Example of multi level inheritance:
 class A
{

};

class B: public A
{
 };
 class C: public B
{
 };

Ø Multiple inheritance : One class being derived from multiple parent classes.


Example of multiple inheritance:

class A
{

};

class B
{
 };
class C: public B, public A
{
};
     
Ø Hybrid inheritance : It is a mixture of 2 or more of above types of inheritance. There is no pattern of deriving from classes. 

 Example of hybrid inheritance:

 class A
{

};

class B
{
 };
 class C: public A, public B
{
 };
 class D: public A
{
};
 
class X: public D, public C
{
};

Ø Hierarchial inheritance : Many classes deriving from one class. 

Example of hierarchical inheritance:

class A
{

};

class B: public A
{
};
class C: public A
{
};


DATA ABSTRACTION

Data abstraction & Encapsulation

The wrapping up of data and its functions into a single unit is called Encapsulation.
When using Data Encapsulation, data is not accessed directly, it is only accessible through the functions present inside the class.

Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details.


Abstraction refers to the act of representing essential features without including the background details or explanation between them.

CLASS

Class

Classes are data types based on which objects are created. Objects with similar properties and methods are grouped together to form a Class. Thus a Class represents a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects become functions of the class and is referred to as Methods.

OBJECT

Object
Object is the basic unit of object-oriented programming. Objects are identified by its unique name. An object represents a particular instance of a class. There can be more than one instance of an object. Each instance of an object can hold its own relevant data.
An Object is a collection of data members and associated member functions also known as methods.
For example :: whenever a class name is created according to the class an object should be created without creating object can’t able to use class.

The Applet CLASS



The Applet CLASS:

 

Every applet is an extension of the java.applet.Applet class. The base Applet class provides methods that a derived Applet class may call to obtain information and services from the browser context.
These include methods that do the following:
·         Get applet parameters
·         Get the network location of the HTML file that contains the applet
·         Get the network location of the applet class directory
·         Print a status message in the browser
·         Fetch an image
·         Fetch an audio clip
·         Play an audio clip
·         Resize the applet

COMPUTER - APPLICATIONS

Following list demonstrates the various applications of Computers in today's arena.


Business

The computer's characteristic as high speed of calculation, diligence, accuracy, reliability, or versatility has made it an integrated part in all business organisations.
Computer is used in business organisation for:

Ø  Payroll Calculations
Ø  Budgeting
Ø  Sales Analysis
Ø  Financial forecasting
Ø  Managing employees database
Ø  Maintenance of stocks, etc.


Banking

Today Banking is almost totally dependent on computer.
Banks provide following facilities:

Ø  Banks on-line accounting facility, which includes current balances, deposits, overdrafts, interest charges, shares and trustee records.
Ø  ATM machines are making it even easier for customers to deal with banks.


Insurance

Insurance companies are keeping all records up-to-date with the help of computers. The Insurance Companies, Finance houses and Stock broking firms are widely using computers for their concerns.
Insurance Companies are maintaining a database of all clients with information showing:

Ø  how to continue with policies
Ø  starting date of the policies
Ø  next due instalment of a policy
Ø  maturity date
Ø  interests due
Ø  survival benefits
Ø  bonus


Education

The computer has provided a lot of facilities in the Education System.

Ø  The uses of computer provide a tool in the Education system known as CBE (Computer Based Education).
Ø  CBE involves Control, Delivery and Evaluation of learning.
Ø  The computer education is very familiar and rapidly increasing the graph of computer students.
Ø  There are number of methods in which educational institutions can use computer to educate the students.
Ø  It is used for prepare a database about student performance and analyses are carried out.


Marketing

In Marketing uses of computer are following:

Ø  Advertising: With computers, advertising professionals create art and graphics, write and revise copy, and print and disseminate ads with the goal of selling more products.
Ø  At Home Shopping: Home shopping has been made possible through use of computerised catalogues that provide access to product information and permit direct entry of orders to be filled by the customers.


Health Care

Computers have become important part in all Medical Systems.
The computers are being used in hospitals to keep the record of patients and medicines. It is also used in scanning and diagnosing different diseases. ECG, EEG, Ultrasounds and CT Scans, etc., are also done by computerised machines.
Some of major fields of health care in which computers are used:

Ø  Diagnostic System: Computers are used to collect data and identify cause of illness.
Ø  Lab-diagnostic System: All tests can be done and reports are prepared by computer.
Ø  Patient Monitoring System: These are used to check patient's signs for abnormality such as in Cardiac Arrest, ECG, etc.
Ø  Pharma Information System: Computer checks Drug-Labels, Expiry dates, harmful drug side effects, etc.
Ø  Nowadays, computers are also used in performing surgery.


Engineering Design

Computers are widely used in Engineering purposes.
One of major areas is CAD (Computer aided design). CAD provides creation, edition, and modification of image. Some fields are:

Ø  Structural Engineering: Requires stress and strain analysis required for design of Ships, Buildings, Budgets, Airplanes, etc.
Ø  Industrial Engineering: Computers deal with design, implementation and improvement of Integrated systems of people, materials and equipments.
Ø  Architectural Engineering: Computers help in planning towns, designing buildings, determining a range of buildings on a site using both 2D and 3D drawings.


Military

Computers are largely used in defence. Modern tanks, missiles, weapons, etc., employ computerised control systems. Some military areas where a computer has been used are:

Ø  Missile Control
Ø  Military Communication
Ø  Military operation and planning
Ø  Smart Weapons


Communication

Communication means to convey a message, an idea, a picture or speech that is received and understood clearly and correctly by the person for whom it is meant. Some main areas in this category are:

Ø  E-mail
Ø  Chatting
Ø  Usenet
Ø  FTP
Ø  Telnet
Ø  Video-conferencing


Government Applications

Computers play an important role in government applications. Some major fields in this category are:

Ø  Budgets
Ø  Sales tax department
Ø  Income tax department
Ø  Male/Female ratio
Ø  Computerization of voters lists
Ø  Computerization of Driving Licensing system
Ø  Computerization of PAN card