Results 1 to 3 of 3
Thread: array of objects
- 06-14-2007, 04:20 PM #1
Senior Member
- Join Date
- Jun 2007
- Posts
- 130
- Rep Power
- 0
array of objects
I want to store the parameters that the user enter into an array call "pupil" but I can't do it
This is the code:
Java Code:public class Main { public static void main(String[] args) throws Exception { Pupil ingr; char createProd; int counter=0; do{ System.out.println(" Do you want to start to enter products s/n"); createProd= (char)System.in.read(); System.in.read(); if (createProd!= 'N') { ingr= new Pupil(); String id = Console.readLine("Identification"); int idd = Integer.parseInt(id); String name = Console.readLine("Name:"); String lastname= Console.readLine("Lastname:"); String age = Console.readLine("age"); int aged1= Integer.parseInt(age); ingr.setId(idd); ingr.setName(name); ingr.setSurname(surname ); counter++; } } while (createProd== 'S'); //DataBase bd = new DataBase (); DataBase .getPupilsDetails(); } }Last edited by Jack; 07-02-2007 at 05:18 AM.
- 07-02-2007, 05:22 AM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 164
- Rep Power
- 6
Why don't you use collections instead of arrays?
Is much better than arrays
try it, if you want I help you
- 07-02-2007, 05:24 AM #3
Senior Member
- Join Date
- Jun 2007
- Posts
- 110
- Rep Power
- 0
Similar Threads
-
Creating an array of nonprimitive objects
By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 08:46 PM -
Traversing through a stack of objects, and puttin them info in an array
By szimme101 in forum New To JavaReplies: 1Last Post: 03-25-2008, 05:06 AM -
Array of Objects
By bluefloyd8 in forum New To JavaReplies: 5Last Post: 01-22-2008, 06:27 PM -
Array with objects
By toby in forum New To JavaReplies: 1Last Post: 07-25-2007, 09:50 AM -
Help with Objects!
By Shorinhio in forum New To JavaReplies: 1Last Post: 07-10-2007, 09:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks