.NET Practice Test – 7 Posted by Editor Date 2022-10-12 Comments 0 comment Welcome to your .NET Practice Test - 7 Which of the following is the correct way to overload + operator? A. public sample operator + ( sample a, sample b ) B. public abstract operator + ( sample a, sample b) C. public abstract sample operator + (sample a, sample b ) D. public static sample operator + ( sample a, sample b ) Struct’s data members are ___ by default. A. Protected B. Public C. Private D. Default Which of the following statements is correct? A. When used as a modifier, the new keyword explicitly hides a member inherited from a base class. B. Operator overloading works in different ways for structures and classes. C. It is not necessary that all operator overloads are static methods of the class. D. Sealed methods of parent classes can be overridden by child class. Which of the following statements is correct? A. Static methods can be virtual. B. Abstract methods can be virtual. C. It is necessary to override a virtual method. D. When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overridden. E. We can override virtual as well as non-virtual methods. Which of the following statements is correct about constructors in C#.NET? A. A constructor cannot be declared as private B. A constructor cannot be overloaded C. A constructor can be a static constructor D. None of the above Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member? A. new B. base C. virtual D. override Which of the following is the correct about static member variables of a class? A. We can define class member variables as static using the static keyword. B. When we declare a member of a class as static, it means no matter how many objects of the class are created, there is only one copy of the static member. C. Both of the above. D. None of the above. Which of the following operator determines whether an object is of a certain type in C#? A. is B. typeof C. as D. sizeof What will be the output of the following code snippet? static void Main(string[] args) { int x = 8; int b = 16; int c = 64; x /= c /= b; Console.WriteLine(x + " " + b+ " " +c); Console.ReadLine(); } A. 2 16 4 B. 4 8 16 C. 2 4 8 D. 8 16 64 Which of the following converts a type to a single Unicode character, where possible in C#? A. ToSingle B. ToByte C. ToChar D. ToDateTime Time is Up! Time's up Share: Editor Previous post .NET Practice Test - 6 2022-10-12 You may also like Oracle Tutorial Videos 8 April, 2023 Spring Tutorial Videos 8 April, 2023 Ui Technologies Tutorial Videos 1 April, 2023