.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

BCT Commander- Save $6.00
World Supremacy- Save $10.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old July 24th, 2009, 03:05 AM
hEad's Avatar

hEad hEad is offline
Sergeant
 
Join Date: Dec 2007
Location: WA, Australia
Posts: 228
Thanks: 18
Thanked 7 Times in 5 Posts
hEad is on a distinguished road
Default Re: O.T Help sought from Java Programmers

I really want to that you all for your help. I am studying for my degree correspondence because I'm a small town country hick - up to this point I have found external studies suits me fine, but for this unit... someone on hand to converse with is certainly missed.

I have finished the student class (I think) taking onboard your suggestions - public to private, inversion of assignments etc. I know I should get onto the main(), but needed a small win for some confidence, so Student class needed completion.

I still don't know the why and what of get and set methods, but I believe this will become apparent when I start fiddling with the array.


public class Student {

private String studentID;
private String firstName;
private String lastName;
private String gender;
private String dateOfBirth;
private String phoneNumber;
private String yearCommenced;

//Constructor
public Student(String sId, String fn, String ln, String sex, String dOB, String pn, String yc){

studentID = sId;
firstName = fn;
lastName = ln;
gender = sex;
dateOfBirth = dOB;
phoneNumber = pn;
yearCommenced = yc;
}
//Get methods
public String getStudentID(){
return studentID;
}
public String getFirstName(){
return firstName;
}
public String getLastName(){
return lastName;
}
public String getGender(){
return gender;
}
public String getDateOfBirth(){
return dateOfBirth;
}
public String getPhoneNumber(){
return phoneNumber;
}
public String getYearCommenced(){
return yearCommenced;
}
//set methods for data fields

public void setStudentID(String sId){
studentID = sId;
}
public void setFirstName(String fn){
firstName = fn;
}
public void setLastName(String ln){
lastName = ln;
}
public void setGender(String sex){
gender = sex;
}
public void setDateOfBirth(String dOB){
dateOfBirth = dOB;
}
public void setPhoneNumber(String pn){
phoneNumber = pn;
}
public void setYearCommenced(String yc){
yearCommenced = yc;
}
}

In the ball park?
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:48 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.