In the written examination conducted by WebSoft Solutions Pvt. Ltd., candidates are given certain advanced C# codes. They are asked to find the errors in the code (if any) and predict the output of the code. You are one of the candidates appearing at the interview. Optimize the code, find out the errors (if any), and predict the output of the following code snippet: [10 Marks]
using System; class Student { private string name = "Marcus Trott"; private double marks = 65.0; public void DispName() { System.Console.WriteLine("Name: ",; name); } public void DispMarks() { System.Console.WriteLine("Marks: ", marks); } }
class MainClass { static void Main() { Student s= new Student(); string n = s.DispName(); double m= s.marks; } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment