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:
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.
类是将数据成员和方法封装在一起的模板。
在C#中,类是预定义的关键字。
我们只能使用预定义类。
一个类占用固定的10字节内存空间。
选项:
正确答案:3
A和B
类是在逻辑上将数据成员和关联的方法封装在一起的模板。 要创建新类,我们需要使用预定义的关键字class 。
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:
Correct answer: 3
C and D
C#.NET supports an object-oriented programming paradigm. Here OOPS gives equal importance to data and associated methods.
C#.NET支持结构化的编程范例。
C#.NET支持面向对象的编程范例。
过程编程范例与结构化编程范例不同。
在面向对象的编程中,方法比数据更重要。
选项:
正确答案:3
C和D
C#.NET支持面向对象的编程范例。 在这里,OOPS将数据和关联方法同等重要。
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:
Correct answer: 4
C and D
In the given statements, C and D are correct statements.
C#.NET中的类只能包含实例数据成员和实例方法。
在C#.NET中,我们可以创建朋友功能。
类是一个蓝图,通过它我们可以创建该类的对象。
在C#.NET中,只能使用类的对象访问类的实例成员。
选项:
正确答案:4
C和D
在给定的语句中,C和D是正确的语句。
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:
Correct answer: 4
C and D
In the given statements, C and D are correct statements.
使用默认名称创建对象,我们无法为对象分配名称。
在堆段中创建了小型对象。
类是引用类型。
我们可以创建用户定义的类来实现功能。
选项:
正确答案:4
C和D
在给定的语句中,C和D是正确的语句。
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:
Correct answer: 3
A and D
In the given statements, A and D are correct statements.
默认情况下,在C#.NET中,该类的数据成员是私有的。
默认情况下,在C#.NET中,该类的数据成员是公共的。
默认情况下,在C#.NET中,该类的方法是公共的。
在C#.NET中,私有方法可以访问相同类的公共方法。
选项:
正确答案:3
A和D
在给定的语句中,A和D是正确的语句。
翻译自: https://www.includehelp.com/dot-net/csharp-class-object-aptitude-questions-and-answers-1.aspx
c# 类对象和实例对象