title: How to create a Java class with data fields
body: <p>I am in a programming class that has provided me with a project but I have no idea where to start and was hoping someone could push me in the right direction. I am only posting part of the project so that someone can show me a bit of the code to get an idea of how its done as I have taken a programming class before but I am out of practice.</p>
  
  <blockquote>
    <p>Create an application called Registrar that has the following classes:</p>
    
    <p>A Student class that minimally stores the following data fields for a student:</p>
    
    <ul>
    <li>Name</li>
    <li>Student id number</li>
    <li>Number of credits</li>
    </ul>
    
    <p>The following methods should also be provided:</p>
    
    <ul>
    <li>A constructor that initializes the name and id fields</li>
    <li>A method that returns the student name field<br></li>
    <li>Methods to set and retrieve the total number of credits<br></li>
    </ul>
  </blockquote>
  
  <p>I have removed most of the question as I am not trying to get the full answer but to just get this little sample to try to get going on the rest of the project. 
  I am also having trouble with the 2nd part as to how I can create names and ID's on a second program and retrieve them into the first program with the classes.</p>