c# 类对象和实例对象_C#类和对象能力问题 套装1

c# 类对象和实例对象

1) There are following statements are given below, which of them are correct about classes in C#?
  1. Class is a template that encapsulates data members and methods together.

  2. In C#, a class is a predefined keyword.

  3. We can use only predefine classes.

  4. A class occupies a fixed 10-byte memory space.

Options:

  1. Only B

  2. Only C

  3. A and B

  4. Only D

Answer & Explanation

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.

1)下面给出了以下语句,其中哪些对于C#中的类是正确的?
  1. 类是将数据成员和方法封装在一起的模板。

  2. 在C#中,类是预定义的关键字。

  3. 我们只能使用预定义类。

  4. 一个类占用固定的10字节内存空间。

选项:

  1. 只有B

  2. 只有C

  3. A和B

  4. 只有D

答案与解释

正确答案:3
A和B

类是在逻辑上将数据成员和关联的方法封装在一起的模板。 要创建新类,我们需要使用预定义的关键字class 。

2) There are following statements are given below, which of them are correct about the programming paradigm?
  1. C#.NET supports a structured programming paradigm.

  2. C#.NET supports an object-oriented programming paradigm.

  3. The procedural programming paradigm is not the same as a structured programming paradigm.

  4. In Object-Oriented programming, methods are more important than data.

Options:

  1. Only A

  2. Only B

  3. C and D

  4. Only D

Answer & Explanation

Correct answer: 3
C and D

C#.NET supports an object-oriented programming paradigm. Here OOPS gives equal importance to data and associated methods.

2)下面给出了以下语句,其中哪些是正确的编程范例?
  1. C#.NET支持结构化的编程范例。

  2. C#.NET支持面向对象的编程范例。

  3. 过程编程范例与结构化编程范例不同。

  4. 在面向对象的编程中,方法比数据更重要。

选项:

  1. 只有一个

  2. 只有B

  3. C和D

  4. 只有D

答案与解释

正确答案:3
C和D

C#.NET支持面向对象的编程范例。 在这里,OOPS将数据和关联方法同等重要。

3) There are following statements are given below, which of them are correct in C#.NET?
  1. A class in C#.NET can contain only an instance data member and instance methods.

  2. In C#.NET we can create friend function.

  3. A class is a blueprint by which we can create objects of the class.

  4. In C#.NET, Instance members of a class can only be accessed using the object of the class.

Options:

  1. Only A

  2. Only B

  3. Only C

  4. C and D

Answer & Explanation

Correct answer: 4
C and D

In the given statements, C and D are correct statements.

3)下面给出了以下语句,其中哪些在C#.NET中正确?
  1. C#.NET中的类只能包含实例数据成员和实例方法。

  2. 在C#.NET中,我们可以创建朋友功能。

  3. 类是一个蓝图,通过它我们可以创建该类的对象。

  4. 在C#.NET中,只能使用类的对象访问类的实例成员。

选项:

  1. 只有一个

  2. 只有B

  3. 只有C

  4. C和D

答案与解释

正确答案:4
C和D

在给定的语句中,C和D是正确的语句。

4) There are following statements are given below, which of them are correct in C#.NET?
  1. Objects are created with a default name, we cannot assign a name to the objects.

  2. Small size objects are created in the heap segment.

  3. Class is a reference type.

  4. We can create user define classes to implement the functionality.

Options:

  1. Only A

  2. Only B

  3. A and B

  4. C and D

Answer & Explanation

Correct answer: 4
C and D

In the given statements, C and D are correct statements.

4)下面给出了以下语句,其中哪些在C#.NET中正确?
  1. 使用默认名称创建对象,我们无法为对象分配名称。

  2. 在堆段中创建了小型对象。

  3. 类是引用类型。

  4. 我们可以创建用户定义的类来实现功能。

选项:

  1. 只有一个

  2. 只有B

  3. A和B

  4. C和D

答案与解释

正确答案:4
C和D

在给定的语句中,C和D是正确的语句。

5) There are following statements are given below, which of them are correct in C#.NET?
  1. In C#.NET by default data members of the class are private.

  2. In C#.NET by default data members of the class are public.

  3. In C#.NET by default methods of the class are public.

  4. In C#.NET private methods can access public methods of the same class.

Options:

  1. Only A

  2. Only B

  3. A and D

  4. B and C

Answer & Explanation

Correct answer: 3
A and D

In the given statements, A and D are correct statements.

5)下面给出了以下语句,其中哪些在C#.NET中正确?
  1. 默认情况下,在C#.NET中,该类的数据成员是私有的。

  2. 默认情况下,在C#.NET中,该类的数据成员是公共的。

  3. 默认情况下,在C#.NET中,该类的方法是公共的。

  4. 在C#.NET中,私有方法可以访问相同类的公共方法。

选项:

  1. 只有一个

  2. 只有B

  3. A和D

  4. B和C

答案与解释

正确答案:3
A和D

在给定的语句中,A和D是正确的语句。

翻译自: https://www.includehelp.com/dot-net/csharp-class-object-aptitude-questions-and-answers-1.aspx

c# 类对象和实例对象

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值