Answer to Question #167428 in C# for Habib

Question #167428

Modify class for Client that it only shows "Client creating" on screen for the object initialization only.


1
Expert's answer
2021-03-01T07:55:23-0500
class Program
    {
        static void Main(string[] args)
        {
            // Example of program usage
            Client client = new Client();


            Console.ReadKey();
        }
    }


    class Client
    {
        public Client() // Constructor that shows "Client creating" when initializing an object
        {
            Console.WriteLine("Client creating"); 
        }
    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS