Trending ▼   ResFinder  

ICSE 2006 solved : Computer Applications

21 pages, 9 questions, 0 questions with responses, 0 total responses,    0    0
Manasa Preethi
Sikkim manipal university, Bangalore
Master of Science Information Technology
+Fave Message
 Home > manumansi >

Formatting page ...

ICSE 2006 Q1. (a) Define encapsulation. [2 marks] A1. (a) Encapsulation is the process of hiding the implementation details of a class and allowing access to the class through a public interface. Encapsulation makes it easy to maintain and modify code. For example, if we change the internal design of the class, the variable names, their data types, and so on, that change need not be known to the users of the class. They can still continue to use the same publicmethods only. Encapsulation, when used in the proper manner, makes it easy to define methods with standard names. For example, if an instance variable is called x, then the method to get the value of x is called getX(), and the method to set the value of x is called setX(). Such methods are also known as getter methods and setter methods. Q1. (b) Explain the term object using an example. [2 marks] A1. (b) An object is an instance of a class; a class is a blueprint based on which objects of that class can be created. The blueprint specifies the variables of that object as well as the behaviour of the objects of that class (methods). class Car { // instance variables int gears, speed; public Car() // constructor { gears = 5;

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

manumansi chat