Note that there are some explanatory texts on larger screens.

plurals
  1. POInaccesible due to its Protection level? Help me please
    primarykey
    data
    text
    <p>I need help figuring this out, what am I doing wrong my book doesn't give a clear explanation on how to deal with this and neither does the online help in VS2008.<br> Can you show me how to do this correctly?</p> <p>Another error I am getting:</p> <blockquote> <p>Cannot Create an instance of the abstract class or interface "Person.Person"</p> <p>Member Person.Person.rnd' cannot be accessed with an instance reference; qualify it with a type name instead</p> </blockquote> <p>Person.cs</p> <pre><code> public abstract class Person { private string title; private string firstName; private string lastName; private string address; private string gender; private string dateOfBirth; private string userID; static Random rnd = new Random(); // constructors public Person() { }//end default constructor public Person(string aTitle, string aFirstName, string aLastName, string aAddress, string aGender, string aDateOfBirth) { title = aTitle; firstName = aFirstName; lastName = aLastName; address = aAddress; gender = aGender; dateOfBirth = aDateOfBirth; } } </code></pre> <p>Student.cs </p> <pre><code> public class Student: Person { public override string GenerateUserID() { this.userID = firstName.Substring(0, 1) + lastName.Substring(0, 5); //ERROR HAPPENS HERE this.userID = this.userID + this.rnd.Next(1000, 9999); }//end method Generate UserID } </code></pre> <p>PersonTest.cs</p> <pre><code>static void Main(string[] args) { //ERROR HAPPENS HERE TOO Cannot Create an instance of the abstract class or interface "Person.Person" Person testPerson = new Person("Mr.", "Merry ", "Lanes", " 493 Bluebane RD", "Male", " 8-06-1953 "); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload