Preview

Question & Answer

Powerful Essays
Open Document
Open Document
1915 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Question & Answer
1.Does C# support multiple-inheritance?
No. But you can use Interfaces.

2.Where is a protected class-level variable available?
It is available to any sub-class derived from base class

3.Are private class-level variables inherited?
Yes, but they are not accessible.

4.Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class.

6.Which class is at the top of .NET class hierarchy?
System.Object.

7.What does the term immutable mean?
The data value may not be changed.
Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

8.What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable.
System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

9.What’s the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.

10.Can you store multiple data types in System.Array?
No.

11.What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.

12.How can you sort the elements of the array in descending order?
By calling Sort()

You May Also Find These Documents Helpful

  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Good Essays

    This is used by Microsoft to seamlessly create a client/server model in Windows NT, with very little effort.…

    • 438 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Is3440

    • 534 Words
    • 3 Pages

    3. If a file is set with the immutable flag, what security controls does this provide for the file?…

    • 534 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    It is made up of a group of libraries running as a layer on top of the operating system which programmers can call on to add functionality to the program they are writing. It uses applications such as printing, mouse clicks, data saving, copy, paste and many more. The main advantage of these libraries are that they are already written, debugged and backwards compatible with older versions of programs using the .NET framework.…

    • 1025 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    Pt2520 Unit 6

    • 1447 Words
    • 6 Pages

    It occurs when we can change the file structure without affecting the accessibility of the data.…

    • 1447 Words
    • 6 Pages
    Powerful Essays
  • Better Essays

    1) You can call the module several times instead of writing it out each time.…

    • 1580 Words
    • 11 Pages
    Better Essays
  • Good Essays

    7 and Array

    • 500 Words
    • 2 Pages

    7. When a single array element, such as myArray[2], is passed to a method, the method receives _____.…

    • 500 Words
    • 2 Pages
    Good Essays
  • Good Essays

    It seems that both need each others presence but Kristie wants more of a committed relationship than Jacob, she wants him to be all in but Jacob feels its unnecessary to communicate with Kristie & get and understanding he rather just make things happen than to talk about making them happen.…

    • 459 Words
    • 2 Pages
    Good Essays
  • Good Essays

    ISSC362 Lab 2 Assessment

    • 492 Words
    • 2 Pages

    The Hash Value is set to a exactly the value so once it is altered the values will change to the alteration.…

    • 492 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Each new class obtained through inheritance is known as derived class, and classes from which it derives are called base classes. In addition, each derived class can be used as a base class for a new derived class. And each derived class can be one or more base classes. In the latter case are referred to bypass manifold.…

    • 290 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Foreshadowing is used because the author tells about the mother’s beliefs about predisposed child dangers and deaths. Soon after, her…

    • 1054 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Response

    • 440 Words
    • 2 Pages

    The power of myths was an event that changed many lives. Joseph Campbell dedicated his live and scholarly work to study the myths for an explanation of consciousness. His work isn’t just a collection of interesting exotic stories but they are for those who are willing to imagine their rich inner life. Campbell explains there are “four function of myth.” The first function is for the individual to explore their inner goddess, finding if the mystery exist. The second function is to explain everything that one may come in contact with. The second function explains the image of cosmos. The third function is a shared set of right and wrongs. These common beliefs are what a society depends on. The last function that Campbell explains is the fourth function is what supposedly carries an individual through life, from childbirth to death. This function is to understand the individuals’ social order in life.…

    • 440 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    I first discovered this feature while working with an OEM client developing a packaged BusinessObjects…

    • 1010 Words
    • 4 Pages
    Powerful Essays
  • Powerful Essays

    Java Inheritance

    • 4859 Words
    • 20 Pages

    The base class and all derived classes are “classes as usual”. What connects them is that all derived classes must have “extends” clause in the declaration.…

    • 4859 Words
    • 20 Pages
    Powerful Essays
  • Powerful Essays

    Liham Pangaplikasyon

    • 6908 Words
    • 28 Pages

    Let's say a thread retrieves the value of x, but hasn't stored it yet. Another thread can also retrieve the samevalue of x (because no thread has changed it yet) and then they would both be storing the samevalue (x+1) back in x!…

    • 6908 Words
    • 28 Pages
    Powerful Essays

Related Topics