Home »
Aptitude Questions and Answers »
C# Aptitude Questions and Answers
C# Class & Object Aptitude Questions and Answers | Set 1
C# Class & Object Aptitude Questions | Set 1: This section contains aptitude questions and answers on C# Class & Object.
Submitted by Nidhi, on April 12, 2020
1) There are following statements are given below, which of them are correct about classes in C#?
- Class is a template that encapsulates data members and methods together.
- In C#, a class is a predefined keyword.
- We can use only predefine classes.
- A class occupies a fixed 10-byte memory space.
Options:
- Only B
- Only C
- A and B
- Only D
Correct answer: 3
A and B
Class is a template that logically encapsulates data member and associated methods together. To create new classes we need to use pre-defined keyword class.
2) There are following statements are given below, which of them are correct about the programming paradigm?
- C#.NET supports a structured programming paradigm.
- C#.NET supports an object-oriented programming paradigm.
- The procedural programming paradigm is not the same as a structured programming paradigm.
- In Object-Oriented programming, methods are more important than data.
Options:
- Only A
- Only B
- C and D
- Only D
Correct answer: 3
C and D
C#.NET supports an object-oriented programming paradigm. Here OOPS gives equal importance to data and associated methods.
3) There are following statements are given below, which of them are correct in C#.NET?
- A class in C#.NET can contain only an instance data member and instance methods.
- In C#.NET we can create friend function.
- A class is a blueprint by which we can create objects of the class.
- In C#.NET, Instance members of a class can only be accessed using the object of the class.
Options:
- Only A
- Only B
- Only C
- C and D
Correct answer: 4
C and D
In the given statements, C and D are correct statements.
4) There are following statements are given below, which of them are correct in C#.NET?
- Objects are created with a default name, we cannot assign a name to the objects.
- Small size objects are created in the heap segment.
- Class is a reference type.
- We can create user define classes to implement the functionality.
Options:
- Only A
- Only B
- A and B
- C and D
Correct answer: 4
C and D
In the given statements, C and D are correct statements.
5) There are following statements are given below, which of them are correct in C#.NET?
- In C#.NET by default data members of the class are private.
- In C#.NET by default data members of the class are public.
- In C#.NET by default methods of the class are public.
- In C#.NET private methods can access public methods of the same class.
Options:
- Only A
- Only B
- A and D
- B and C
Correct answer: 3
A and D
In the given statements, A and D are correct statements.