Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# ToString method ๐Ÿ’ญ
Play lesson

C# tutorial for beginners ๐ŸŽต - C# ToString method ๐Ÿ’ญ

5.0 (6)
48 learners

What you'll learn

This course includes

  • 4 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

C# toString() method tutorial example explained #C# #ToString #method using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { //ToString() = converts an object to its string representation so that it is suitable for display Car car = new Car("Chevy", "Corvette", 2022, "blue"); Console.WriteLine(car.ToString()); Console.ReadKey(); } } class Car { String make; String model; int year; String color; public Car(String make, String model, int year, String color) { this.make = make; this.model = model; this.year = year; this.color = color; } public override string ToString() { return "This is a " + make + " " + model; } } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

FAQs

Course Hive
Download CourseHive
Keep learning anywhere