Charles Bell
Posts: 519
Nickname: charles
Registered: Feb, 2002
|
|
Re: java
|
Posted: Feb 5, 2011 6:20 AM
|
|
/**
create a constructor that accepts 5 string and stores them in 5 variables strings call sNum, sName, rDate, rTime, eNum.
*/
public class StringStorage{
public String sNum, sName, rDate, rTime, eNum ="";
/**
The Constructor that accepts 5 string and stores them in 5 variables strings call sNum, sName, rDate, rTime, eNum.
*/
public StringStorage(String s1, String s2,String s3,String s4,String s5){
sNum = s1;
sName = s2;
rDate = s3;
rTime = s4;
eNum = s5;
}
public static void main(String[] args){
System.out.println(new StringStorage("one","two","three","four","five"));
}
public String toString(){
return sNum + ", " + sName + ", " + rDate + ", " + rTime + ", " + eNum;
}
}
|
|