11th Standard Syllabus & Materials
11th Standard
TN 11th English Supplementary - 3 - The First Patient (Play) Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th English Prose - 3 - Forgetting Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th English Prose - 2 - The Queen of Boxing Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th English Poem - 1 - Once Upon A Time Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th English Prose - 1 - The Portrait of a Lady Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th Computer Applications Tamil Computing Sample Question Papers Study Material - QB365 Set A

Published on: 14/12/2019
Classes and Objects
Download Tamil Nadu 11th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
The default access specifier of class members is ________.
private
protected
public
a or c
2.
By default, class members are treated as ________.
protected
private
either a or b
public
3.
The body of the class enclosed and terminated with ________.
{ }, ;
[ ], ;
< >, ,
( ), ;
4.
Which of the following is used to create user defined datatype?
properties
operations
behaviour
class
5.
Which of the following is needed to represent real world entities?
objects
Modules
classes
none of these
6.
Write the general syntax for calling the member function
7.
What is global class?
8.
Write a short note on class members
9.
Write the importance of defining inline members functions.
10.
What are the two ways of class member functions?
11.
Explain default constructor with an example.
12.
What are the functions of constructor?
13.
Write a short note on memory allocation of objects.
14.
What is inline and outline member function?
15.
Differentiate implicit call and explicit call of involving parameterized constructor.
16.
What is containership write a C++ program to illustrate the containership
17.
Explain how the objects can be passed in pass reference method.
18.
Write a C++ program example of creating global and local object
19.
Explain the different methods of creating an object in C++.
1.
(a)
private
2.
(d)
public
3.
(a)
{ }, ;
4.
(d)
class
5.
(c)
classes
6.
The general syntax for calling the member function is:
Object_name. function _name( actual parameter);
7.
If a class definition is specified outside the body of all functions in a program then it is called global class.
8.
Class comprises of members. Members are classified as Data Members and Member functions. Data members are the data variables that represent the features or properties of a class. Member functions are the functions that perform specific tasks in a class. Member functions are called as methods, and data members are also called as attributes.
9.
If a functions is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time.
10.
The member functions of a class can be defined in two days.
(i) Inside the class definition
(ii) Outside the class definition
11.
A constructor that accepts no parameter is called default constructor. For example in the class data program Data :: Data ( ) is the default constructor. Using this constructor. objects are created similar to the way the variables of other data types are created.
Example
int num; // ordinary variable declaration
Data d1; // object declaration
12.
As we know now that the constructor is a special initialization member function of a class that is called automatically whenever an instance of a class is declared or created. The main function of the constructor is
(i) To allocate memory space to the object and
(ii) To initialize the data member of the class object
13.
The member functions are created and placed in the memory space only when they are defined as a part of the class specification. Since all the objects belonging to that class use the same member function, no separate space is allocated for member functions when the objects are created. Memory space required for the member variable are only allocated separately for each object because the member variables will hold different data values for different objects.
14.
Inside the class definition:
When a member function is defined inside a class, it behaves like inline functions. These are called Inline member functions.
Outside the class definition:
When Member function defined outside the class just like normal function definition (Function definitions you are familiar with) then it is be called as outline member function or non-inline member function.
15.
Implicit call: In this method, the parameterized constructor is invoked automatically whenever an object is created. For example simple s1(10,20); in this for creating the object s 1 parameterized constructor is automatically invoked.
Explicit call: In this method, the name of the constructor is explicitly given to invoke the parameterized constructor so that the object can be created and initialized.For example: simple s1=simple(10,20); //explicit call.
16.
Whenever an object of a class is declared as a member of another class it is known as a container class. In the container-ship the object of one class is declared in another class.
Illustration: C++ program to illustrate the containership
#include < iostream >
using namespace std;
class outer
{
int date;
public:
void get ( );
};
class inner
{
int value;
outer ot;
//object ot of class outer is declared in
class inner
public;
void getdata( );
};
void outer::get( )
{
cout << "\nEnter a value";
cin >> data;
cout << "\nThe given value is" << data;
}
void inner:: getdata( )
{
cout << "\nEnter a value";
cin >> value;
cout << "\nThe given value is " << value;
ot.get( ); //calling of get( ) of class outer in getdata( )of class inner
}
int main ( )
{
inner in;
in.getdata( );
return( );
}
Output:
Enter a value 10
To given value is 10
Enter a value 20
The given value is 20
17.
When an object is passed by reference, its memory address is passed to the function so the called function works directly on the original object used in the function call. So any changes made to the object inside the function definition are reflected in original object.
Example: C++ program to illustrate how the pass by reference method work
#include< iostream >
using namespace std;
class Sample
{
private:
int num;
public:
void set (int x)
{
nurn=x;
}
void pass(Sample &obj 1, Sample &obj2)
{
obj 1.num= 100;
obj 2.nurn=200;
cout << "\n\n changed value of object 1" << obj 1.num;
cout << "\n\n changed value of object 2" << obj 2.num;
}
void print ( )
{
cout << num;
}
};
int main( )
{
clrscr( );
Sample s1;
Sample s2;
Sample s3;
s1.set(10);
s2.set(20);
cout << "\n\t\t\Eaxmple program for pass by reference\n\n\n";
cout << "\n\nValue of object 1 before passing?;
s1.print( );
cout << "\n\nValue of object 2 before passing";
s2.print( );
s3.pass(s1,s2);
cout << "\n\nValue of object 1 after passing";
s1.print( );
count << "\n\nValue of object 2 after passing";
s2.print( );
return 0;
}
Output:
Example program for PASS BY REFERENCE
Value of object 1 before passing 10
Value of object 2 before passing 20
Changed value of object 1 100
Changed value of object 2 200
Value of object 1 after passing 100
Value of object 2 after passing 200
18.
#include< iostream >
#include< conio >
using namespace std
class add //Global class
{
int a,b;
public;
int sum;
void getdata( )
{
a=5;
b=10;
sum=a+b;
}
} a1; //global object
add a2; //global object
int main ( )
{
add a3; //Local object for a global class
a1.getdata( );
a2.getdata( );
a3.getdata( );
cout << a1.sum; //public data member accessed from outside the class
cout << a2.sum;
cout << a3.sum;
return 0;
}
Output:
151515
19.
Objects can be created in two methods:
i. Global object,
ii. Local object
(i) Global Object:
If an object is declared outside all the function bodies or by placing their names immediately after the closing brace of the class declaration then it is called as Global object. These objects can be used by any function in the program.
(ii) Local Object:
If an object is declared with in a function then it is called local object. It cannot be accessed from outside the function.
11th Standard Syllabus & Materials
11th Standard
TN 11th Computer Applications Computer Ethics and Cyber Security Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th Computer Applications JavaScript Functions Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th Computer Applications Control Structure in JavaScript Sample Question Papers Study Material - QB365 Set A
NEW11th Standard
TN 11th Computer Applications Introduction to JavaScript Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 11th Standard Subjects

Maths

Commerce

Economics

Biology

Business Maths and Statistics

Accountancy

Computer Science

Physics

Chemistry

Maths

Biology

Economics

Physics

Chemistry

History

Business Maths and Statistics

Computer Science

Accountancy

Computer Applications

History

Computer Technology

Commerce

Computer Applications

Computer Technology

Tamil

English

French
Tamilnadu Stateboard Standards