Tìm kiếm:
TRANG NHÀ
Giới thiệu VNEDU.ORG
Điều khoản và bản quyền
Liên lạc VNEDU
TRẮC NGHIỆM TRỰC TUYẾN
---Công Cụ:---
Soạn Biểu thức
Bảng màu HTML
Ký hiệu đặc biệt 01
Ký hiệu đặc biệt 02
Ký hiệu đặc biệt 03
Ký hiệu đặc biệt 04
Ký hiệu đặc biệt 05
Ký hiệu đặc biệt 06
Ký hiệu đặc biệt 07
Ký hiệu đặc biệt [Toán]
Tin Học   ||  Căn Bản    Văn Phòng    Hệ Thống - Mạng    Phần Mềm Ứng Dụng    Kỹ thuật số    Lập trình    SQL  

Trắc Nghiệm C# - Bài 49
Ngày làm bài: Hôm nay lúc 20:16:27 (Server time)
Số câu hỏi: 10.   Tổng điểm: 10
Yêu cầu hoàn thành: 60 phút.
Thời gian còn lại: 
Cỡ chữ câu hỏi:  Cỡ chữ đáp án:


1-
Which of the following statements are correct?
  1. String is a value type.
  2. String literals can contain any character literal including escape sequences.
  3. The equality operators are defined to compare the values of string objects as well as references.
  4. Attempting to access a character that is outside the bounds of the string results in an IndexOutOfRangeException.
  5. The contents of a string object can be changed after the object is created.
  A - 
1, 3
  B - 
3, 5
  C - 
2, 4
  D - 
1, 2, 4
2-
Which of the following is the correct way to find out the index of the second 's' in the string "She sells sea shells on the sea-shore"?
  A - 
String str = "She sells sea shells on the sea-shore";
int i;
i = str.SecondIndexOf("s");
  B - 
String str = "She sells sea shells on the sea-shore";
int i, j;
i = str.FirstIndexOf("s");
j = str.IndexOf("s", i + 1);
  C - 
String str = "She sells sea shells on the sea-shore";
int i, j;
i = str.IndexOf("s");
j = str.IndexOf("s", i + 1);
  D - 
String str = "She sells sea shells on the sea-shore";
int i, j;
i = str.LastIndexOf("s");
j = str.IndexOf("s", i - 1);
3-
Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{ 
    struct Sample
    {
        public int i;
    }
    class MyProgram
    { 
        static void Main()
        {
            Sample x = new Sample(); 
            x.i = 10; 
            fun(x); 
            Console.Write(x.i + " ");
        }
        static void fun(Sample y)
        {
            y.i = 20; 
            Console.Write(y.i + " ");
        } 
    } 
}

  A - 
10 10
  B - 
20 10
  C - 
20 20
  D - 
None of the above
4-
Which of the following is the correct way to define a variable of the type struct Emp declared below?
struct Emp
{
    private String name; 
    private int age; 
    private Single sal;
}
  1. Emp e(); e = new Emp();
  2. Emp e = new Emp;
  3. Emp e; e = new Emp;
  4. Emp e = new Emp();
  5. Emp e;
  A - 
1, 3
  B - 
2, 5
  C - 
4, 5
  D - 
1, 2, 4
5-
Which of the following statements is correct about the C#.NET code snippet given below?
class Trial
{ 
    int i;
    Decimal d;
}
struct Sample
{
    private int x;
    private Single y;
    private Trial z;
}
Sample ss = new Sample();

  A - 
Trial object referred by z will be created on the stack.
  B - 
z will be created on the heap.
  C - 
Both ss and z will be created on the heap.
  D - 
ss will be created on the stack.
6-
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial
{ 
    int i; 
    Decimal d;
}
struct Sample
{
    private int x; 
    private Single y; 
    private Trial z;
}
Sample samp = new Sample();

  A - 
20 bytes
  B - 
12 bytes
  C - 
8 bytes
  D - 
16 bytes
7-
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
struct Address
{
    private int plotno;
    private String city; 
}
Address a = new Address(); 
Address b; 
b = a;

  A - 
All elements of a will get copied into corresponding elements of b.
  B - 
Address stored in a will get copied into b.
  C - 
Once assignment is over a will get garbage collected.
  D - 
Once assignment is over a will go out of scope, hence will die.
8-
Which of the following statements are correct?
  1. A struct can contain properties.
  2. A struct can contain constructors.
  3. A struct can contain protected data members.
  4. A struct cannot contain methods.
  5. A struct cannot contain constants.
  A - 
1, 2
  B - 
3, 4
  C - 
1, 2, 4
  D - 
3, 5
9-
When would a structure variable get destroyed?
  A - 
When no reference refers to it, it will get garbage collected.
  B - 
Depends upon whether it is created using new or without using new.
  C - 
When it goes out of scope.
  D - 
Depends upon the Project Settings made in Visual Studio.NET.
10-
Which of the following statements is correct about the C#.NET code snippet given below?
struct Book
{
    private String name; 
    private int noofpages; 
    private Single price;
}
Book b = new Book();

  A - 
The structure variable b will be created on the heap.
  B - 
We can add a zero-argument constructor to the above structure.
  C - 
When the program terminates, variable b will get garbage collected.
  D - 
The structure variable b will be created on the stack.
 
[Người đăng: Thành Lãm - ST]
Ghé thăm Kênh của Vị Sư "hai lần chết đi sống lại"
Tu Si Chau Soc Thon

https://www.youtube.com/channel/UCoyC9WTTVR-M3qpTKKEXGnQ

Chau Soc Thon Official Channel


Phong Bảo Official
Phong Bao Official
Xem Nhiều nhất
Trắc Nghiệm Pascal - Bài 20
Trắc Nghiệm ASP.NET - Bài 12
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 16
Trắc Nghiệm ASP.NET - Bài 01
Trắc Nghiệm ASP.NET - Bài 03
Trắc nghiệm C++ - Bài 18
Trắc Nghiệm C# - Bài 53
Trắc Nghiệm ASP.NET - Bài 02
Trắc Nghiệm C# - Bài 42
Trắc Nghiệm Java - Bài 01
Trắc Nghiệm ASP.NET - Bài 04
Trắc Nghiệm Pascal - Bài 22
Trắc Nghiệm ASP.NET - Bài 13
Trắc Nghiệm ASP.NET - Bài 09
Trắc Nghiệm ASP.NET - Bài 08
Trắc nghiệm PHP - Bài 01
Trắc Nghiệm ASP.NET - Bài 06
Trắc Nghiệm ASP.NET - Bài 11
Trắc Nghiệm ASP.NET - Bài 05
Trắc Nghiệm ASP.NET - Bài 23
Đề Xuất
Trắc Nghiệm Java - Bài 34
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 87
Trắc Nghiệm Visual Basic - Bài 24
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 02
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 10
Trắc nghiệm Linux - Bài 67
Trắc nghiệm XML - Bài 21
Trắc Nghiệm ASP.NET - Bài 18
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 33
Trắc Nghiệm Java - Bài 55
Trắc Nghiệm C Sharp - Bài 08
Trắc Nghiệm Pascal - Bài 29
Trắc Nghiệm Thiết Kế Web (English) - Bài 36
Trắc Nghiệm Java - Bài 46
Trắc Nghiệm Thiết Kế Web (English) - Bài 38
Trắc Nghiệm ASP.NET - Bài 02
Trắc Nghiệm C# - Bài 35
Trắc Nghiệm Pascal - Bài 09
Trắc Nghiệm Visual Basic - Bài 41
Trắc Nghiệm Java - Bài 49
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG

free counters