This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to assign 4 classes to each faculty member and delete the class that has been assigned? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to assign 4 classes to each faculty member and delete the class that has been assigned? " Watch "how to assign 4 classes to each faculty member and delete the class that has been assigned? " New topic
Author

how to assign 4 classes to each faculty member and delete the class that has been assigned?

P Willia
Greenhorn

Joined: Oct 08, 2012
Posts: 12
The code below works but im trying to delete each class that has been assigned to each faculty member. Is there a easier way to assign the classes to each member and delete them?:

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 925
    
    2

Hi,
Welcome to the Ranch!

You have said that you are trying to delete each class assigned to a faculty. Have you already written that code? If so, post that code too. Tell us what you have tried and what doesn't work.

Also, you have posted this in JavaFX forum. I don't think this has anything to do with JavaFX. Please CarefullyChooseOneForum before posting the question.
I am moving this to the "Java in General" forum where such questions are answered better.

Also, please UseCodeTags when posting code.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
Welcome to the Ranch (again)

I have applied the code button to your code and you can see how much better it looks. Please use that button in future. Unfortunately you have mixed tabs and spaces for your indenting; you should set the options on your text editor to change tabs to spaces and only use spaces.

I am afraid I cannot see any faculty members, nor can I see classes. All I can see are Strings. You need a faculty member class, and a class class, which you must not call Class because there is already a Class class which represents classes.
Write a Teacher class and a Module class. The teacher class can have an array of up to 4 modules as a field. Give that Teacher class a toString() method. Find out how to use a for‑each loop (=enhanced for loop) and a StringBuilder object to put together the String for the toString method, because you don’t get a helpful output if you try to print an array with println. Forget about all the other methods for the time being; you can add them later. Test your Teacher class with a method like thisSame sort of thing for the Module class. Gradually add methods to the Teacher class. One method at a time. For each method, add a line to the TeacherDemo#start method which runs that method.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to assign 4 classes to each faculty member and delete the class that has been assigned?
 
Similar Threads
BufferedReader help
illegal array reference assignments
Sun Cirtification
Incompatible types
matching reference variables with objects