how can i pass an array of String while the class i made requaiers an int array ?

I made a class of student that has two constructors one is the default constructor Student() and the other is with argument Student(String studentID, String studentName, String research_intrest, String Topic, int[] course, boolean approval, String supervisorID) the object student stores data from a file which my program will read the program requires the user to enter some the data from the consule so the program will store the data if the id is not similar to the data I stored in Student class after I checked if the id is not identical to the stored ones I started to store the new data from the consule by setting them to student object till I stopped to adding an array of courses because student class argument has an int[] course and I have to store a string values I am thinking to convert the string array to char array but I am not sure it will work
the file I am reading from student.txt contains:

1723, Asma, artificial intelligent, How the machine thinks: intelligent learning,1,1,1,1,1,1,true,00023#

1777,Rania, database, nan,1,1,1,0,0,0,false,0#

1003,Sara, network, nan,1,1,1,1,1,1,true,00013#

1743,Roaa, artificial intelligent, nan,1,1,1,0,0,0,false,0#

Here is the code that I have tried so far:




Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Please write Your Answer in Comment Box

Tags:  java, arrays, netbeans, netbeans-8

Post a Comment

0 Comments