Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C# QUESTIONS : PART 11

Process of defining two or more methods within same class that have same name but different parameters list is

method overloading

method overriding

encapsulation

 inheritance

SHOW ANSWER

Which of the following are applicable for overloading?

Constructors

Methods

Both a & b

None of the mentioned

SHOW ANSWER

using System;
public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine(Math.Round(6.5));
            Console.WriteLine(Math.Round(11.5));
        }
    }
 

6 12 

6 11

7 12

7 11

SHOW ANSWER

What Will Be The Output Of The Following Code Snippet:
using System;
public class Program
    {
        public static void Main(string[] args)
        {
            char[] num = { '1', '2', '3' };
            Console.WriteLine(" char array: " + num);
        }
 
    }
 

char array: {123}

char array: [123]

 char array: System.Char[] 

char array: 123

SHOW ANSWER

What Will Be The Output Of The Following Code Snippet:
using System;
public class Program
    {
        public static void Main(string[] args)
        {
            Program obj = null;
            Console.WriteLine(Program.print());
        }
        private static String print()
        {
            return "Hi, I am a Tech-savvy!!";
        }
    }
 

Hi, I am a Tech-savvy!!

Error

The program compiled successfully and nothing is printed

None of the above

SHOW ANSWER

What Will Be The Output Of The Following Code Snippet:
using System;
public class Program
    {
        public static void Main(string[] args)
        {
            string str1 = "TechBeamers";
            string str2 = "Techbeamers";
            if (str1 == str2)
                Console.WriteLine("Both Strings are Equal");
            else
                Console.WriteLine("Both Strings are Unequal");
            if (str1.Equals(str2))
                Console.WriteLine("Both Strings are Equal");
            else
                Console.WriteLine("Both Strings are Unequal");
            Console.ReadLine();
        }
     }
 

Both Strings are Equal
Both Strings are Unequal

Both Strings are Equal
Both Strings are Equal

Both Strings are Unequal 
Both Strings are Unequal

Both Strings are Unequal
Both Strings are Equal

SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in