Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# overloaded constructors ๐Ÿ•
Play lesson

C# tutorial for beginners ๐ŸŽต - C# overloaded constructors ๐Ÿ•

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# overloaded constructors tutorial example explained #C# #overloaded #constructors using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // overloaded constructors = technique to create multiple constructors, // with a different set of parameters. // name + parameters = signature Pizza pizza = new Pizza("stuffed crust", "red sauce", "mozzarella"); Console.ReadKey(); } } class Pizza { String bread; String sauce; String cheese; String topping; public Pizza(String bread) { this.bread = bread; } public Pizza(String bread, String sauce) { this.bread = bread; this.sauce = sauce; } public Pizza(String bread, String sauce, String cheese) { this.bread = bread; this.sauce = sauce; this.cheese = cheese; } public Pizza(String bread, String sauce, String cheese, String topping) { this.bread = bread; this.sauce = sauce; this.cheese = cheese; this.topping = topping; } } }

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