Connecting...

This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of C#
For more information, please see full course syllabus of C#
C# Understanding & Creating Classes
Lecture Description
In this lesson our instructor talks about Understanding & Creating Classes
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
Since this lesson is not free, only the preview will appear on your website.
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
0 answers
Post by Carl Scaglione on September 20, 2017
The C# code that was in the Exercise Files was the namespace InheritableClass. It was topically related, but no where near the same code that was delivered in the lecture. Was this intentional? Looks like interesting code and advanced for this lesson. Look forward to your response.
0 answers
Post by Carl Scaglione on September 20, 2017
Followed along with your video and received unrecoverable compiler errors. In your code, they did not appear and my code was almost identical. When creating the methods 'public void Account() {}', public long Account(string name){ some code}, and public void Account (long ID, string name){}, I received the CS0542 code error: 'Account' member names cannot be the same as their enclosing type. I did change the name of the methods to 'myAccount' and the problem went away, but the objective of the lesson was to show constructors which are supposed to have the same name as the class. I am using Windows 10 and Visual Studio 2017. This is new to me. Do you have any thoughts? I have followed your lectures and this is the first time that such an unresolvable error occurred.
1 answer
Sun Apr 20, 2014 3:19 AM
Post by Thuy Nguyen on April 20, 2014
I learned on Lynda.com that the return type is not part of the method signature, because C# won't know which method you want just based on the return type. But...somehow in this lecture you can have two constructors with the same parameter list and different return types...I don't know what is the right about overloaded methods anymore now.
Even if you can have two methods with the same parameter type but with different return values, would it be good practice to?
1 answer
Sun Apr 20, 2014 3:09 AM
Post by Thuy Nguyen on April 20, 2014
Hi, in Java, I learned that the constructor doesn't return anything, not even void. Why would a constructor return anything in C# if it's job is to create a new object?