The Artima Developer Community
Sponsored Link

Java Answers Forum
java

1 reply on 1 page. Most recent reply: Feb 5, 2011 6:20 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
bob dillion

Posts: 1
Nickname: bluesageme
Registered: Feb, 2011

java Posted: Feb 2, 2011 2:33 PM
Reply to this message Reply
Advertisement
create a constructor that accepts 5 string and stores them in 5 variables strings call sNum, sName, rDate, rTime, eNum.


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: java Posted: Feb 5, 2011 6:20 AM
Reply to this message Reply
/**
	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;
		}
 
}
 

Flat View: This topic has 1 reply on 1 page
Topic: A question about Java array Previous Topic   Next Topic Topic: online survey on Agile concepts in software development and its perception

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use