Home / MCQ Bank / Computer
Computer Classes And Objects In C Sharp Difficulty: Medium

What will be the output of the following C# code? class maths { public int length; public int breadth; public maths(int x, int y) { length = x; breadth = y; Console.WriteLine(x + y); } public maths(double x, int y) { length = (int)x; breadth = y; Console.WriteLine(x * y); } } class Program { static void Main(string[] args) { maths m = new maths(20, 40); maths k = new maths(12.0, 12); Console.ReadLine(); } }

Select the correct option to test your answer:

More Computer Questions

Which element contains major navigational block? Which of the following work is done by BigTop in Hadoop framework? When does the ArrayIndexOutOfBoundsException occur? Which fields are contained within an IEEE Ethernet frame header? 1. Source and destination MAC address 2. Source and destination network address 3. Source and destination MAC address and source and destination network address 4. FCS field You use the get_class_methods() function to return the names of all the methods in the class. Which function will you use to print it on the screen?