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.

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 :)

according to me for this u need to create object for student i.e. s and then access the objects by calling them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.