| | |
java problem
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2004
Posts: 24
Reputation:
Solved Threads: 0
I have a litle problem
please help me whit:
I want to write a methode whit one paramter.
public int studentInformation(int hour){//How long time(hour) he was at school.
- - - - - - --- - - - - -
- - - - - - - - - - - - --
return ;
}
Now I want that the same information(above method) uses for every student.
How can I call it for every student.
How do I write code?
// first I want call it for student1
// then for student2, student3.........
and how do I print it out.
please help me whit:
I want to write a methode whit one paramter.
public int studentInformation(int hour){//How long time(hour) he was at school.
- - - - - - --- - - - - -
- - - - - - - - - - - - --
return ;
}
Now I want that the same information(above method) uses for every student.
How can I call it for every student.
How do I write code?
// first I want call it for student1
// then for student2, student3.........
and how do I print it out.
•
•
Join Date: Oct 2004
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by PeterX
I have a litle problem
please help me whit:
I want to write a methode whit one paramter.
public int studentInformation(int hour){//How long time(hour) he was at school.
- - - - - - --- - - - - -
- - - - - - - - - - - - --
return ;
}
Now I want that the same information(above method) uses for every student.
How can I call it for every student.
How do I write code?
// first I want call it for student1
// then for student2, student3.........
and how do I print it out.
If you need to store information on students (which all follows the same format) and then print it out again you may be better off creating an array.
If you want a number of objects (i.e. each a different student, each holding variables) you would have to creat a student class where the student class would have a method called studentInformation. You would then have a method called printStudentInformation in the same class to print out the information held by this student. In the main, you would create a student and give that student variables. You will be able to create a number of students.
I have a program which i think the architechter is similar, which involves a car class holding information on cars and a method within lets you change or print the information held on each car.
If you want to mail me for any help on this my e-mail is couldridd@aol.com
Dan
![]() |
Similar Threads
- Java Problem with running program (Java)
- Java problem in IE (Web Browsers)
- Java practice questions (Java)
- Java Problem (Windows NT / 2000 / XP)
- maybe java problem? pop up wont show (Web Browsers)
- Problem with JAVA and XP & a few missing choices. *bangs head on desk* (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: could anyone help me out with this java problem??
- Next Thread: Linkedlist Troubles...plz Help
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth chat class classes client code columns component data database designadrawingapplicationusingjavajslider draw eclipse editor error errors event exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance input integer intellij j2me java javaprojects jlabel jme jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source plazmic print problem program programming project property recursion ria scanner screen search server set size sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree windows





