Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java casting

Name: Anonymous 2011-09-20 22:44

Is anyone willing to lend a helping hand? I'm having some trouble getting Patient.add(patientNo()); to work


                // Add patient objects
                if (menuOption.equals("7")) {
                   
               
                String patientNo = "OU107";          
                String patientName = null;
                String procedureDate = null;
                String description = null;
                String supervisingDoctor = null;
                String patientStatus = null;
                new Patient(patientNo, patientName, procedureDate, description, supervisingDoctor, patientStatus);   
               
                ArrayList <String> sr=new ArrayList();
               

                // This wont accept my string
                Patient.add(patientNo());
               
               
                }

Name: Anonymous 2011-09-20 22:45

op here, ArrayList <String> sr=new ArrayList(); should not be there..

the actual arraylist is

                        ArrayList<Patient> PatientList = new ArrayList<Patient>();

Name: Anonymous 2011-09-21 0:19

its been a while since i did java so i've sort of forgotten,
but yea i'd say somethings wrong with the last two lines. google Java ArrayList and this guys has some pretty decent tutorials that might help you out:
www.thenewboston.com
i basically passed uni without attending lectures thanks to this guy.

Name: Anonymous 2011-09-21 0:20

why... do you have "()" after "patientNo"?
it should just be Patient.add(patientNo);

Name: Anonymous 2011-09-21 0:52

Why are you new-ing something and not assigning the result anywhere?

Name: Anonymous 2011-09-21 1:01

1: Where is the variable storing the new instance of Person at line 11? Perhaps you meant Person person = new Person(blee blah);

2: ArrayList <String> sr=new ArrayList(); is incorrect.

ArrayList<String> sr = new ArrayList<String>();

nigger faggot

Name: Anonymous 2011-09-21 2:14

>>6
In Java 7, ArrayList<String> sr = new ArrayLIst<>(); is acceptable.

Name: Anonymous 2011-09-21 2:35

>7
In Java 7 shitting all over your keyboard and passing it to your compiler is acceptable

you should try it

Name: Anonymous 2011-09-21 9:18

GC is shit.

Name: Anonymous 2011-09-21 10:27

>>9 is afraid of being collected because nobody wants to have him as a reference.

Name: Anonymous 2011-09-21 10:38

Sorry >>1, it seems that you forgot to post the actual code you're having trouble with.

Name: Anonymous 2011-09-21 11:34

GC kuso da

Name: Anonymous 2011-09-21 11:55

menuOption.equals("7")

The wonderful world of Java

Name: Anonymous 2011-09-21 18:23

>>13
The pleasure of being javaed inside

Name: Anonymous 2011-09-21 18:24

INSTALL GENTOO ;3

Name: tdavis 2011-09-21 18:44

You need medications as a member variable.  I'll give you some code, hold-on.  It has to be obsficatded so nobody messes with it.

Name: Tedda 2011-09-21 18:51


                // Add patient objects
                if (menuOption.equals("7")) {

                ArrayList<Patient> patients = new ArrayList<Patient>();
              
                String patientNo = "OU107";         
                String patientName = null;
                String procedureDate = null;
                String description = null;
                String supervisingDoctor = null;
                String patientStatus = null;
                Patient patientInstance = new Patient(patientNo, patientName, procedureDate, description, supervisingDoctor, patientStatus);  
              
                Patient.add(patient);

                }

Name: Tedda 2011-09-21 18:52

Patient.add(patient); should be patients.add(patient);

Name: Anonymous 2011-09-21 18:52

>>1
Nigger boy, we aren't mind readers. Post some working code or go back to scrubbing the toilets. Cripes, you are the reason why HR screens people prior to the first interview.

Name: Tedda 2011-09-21 18:55

fucks sake let me redo that:

                // Add patient objects
                if (menuOption.equals("7")) {

                ArrayList<Patient> patientsList = new ArrayList<Patient>();
             
                String patientNo = "OU107";        
                String patientName = null;
                String procedureDate = null;
                String description = null;
                String supervisingDoctor = null;
                String patientStatus = null;
                Patient patientInstance = new Patient(patientNo, patientName, procedureDate, description, supervisingDoctor, patientStatus); 
             
                patientsList.add(patientInstance);

                }

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-21 18:57

>>20
What the hell? Are you fucking stupid? Someone just asked you to post some complete working code. That didn't imply post another code snippet.

Name: Tedda 2011-09-21 18:57

not sure if thats what u are trying to do matey, but it adds the patient object to a list of patient objects. Fuck knows what you were trying to do, i just guessed, all that string nonsense i just ignored.

Name: Anonymous 2011-09-21 19:00

>>22
You both suck. Now I see why I don't hire people like you.

Name: Tedda 2011-09-21 19:01

>>21
Code snippet of what exactly?? im trying to figure out wtf that code is supposed to be doing

Assign values to a bunch of variables
construct a class with those variables
fuck up an arraylist declaration
then add a string to a static class...

now my guess is thats not what he meant to do.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-21 19:03

>>24
I can't tell if you're mentally retarded or just plain stupid. By code snippet, I mean, if I cut and paste your code into my compiler, the thing doesn't run because it isn't complete java working code.

Name: Anonymous 2011-09-21 19:05

er *working java code*. Ya know know Tedda, I don't think anyone else here is gonna help you because quite frankly, you are a stupid nigger. This joint has enough of them. The only reason I'm even giving you the time of day is because I need to be reminded that there are people more pathetic than jews.

Name: Tedda 2011-09-21 19:06

Look im spoon feeding it already, im not chewing it first.

Name: Tedda 2011-09-21 19:08

You want me to make up code, for a code snippet he wrote that doesnt make sense, that probably wouldnt be relevant to his problem anyway? i could code all manner of things and chuck a load of working code up, doesnt mean its what he needed.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-21 19:14

>>28
What isn't relevant to you might be relevant to the rest of us. There error could lie anywhere. So again, either put up some complete working java code that illustrates your problem or just go fuck off and go another board that can read the mind of a retard.

Name: Anonymous 2011-09-21 19:28

ticket outlets

Name: Anonymous 2011-09-21 20:21

>>10

If he can convince the outside environment before the next pass, he'll be safe! Good luck mr.memory-leak!

Name: Anonymous 2011-09-22 0:52

lol at all the idiots who think Tedda is OP.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List