| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> rickety: I can find something out for myself, but when you're taught string1 == string2 how would you know you should use string1.equals(string2) ? <1> I bet you weren't taught that, pay better attention <0> and I don't mean to insult my cl***, but in another module we're learning batch files and (I'm not joking) in a 1.5 hour session they managed to type 6 lines of a batch file. <0> one of the file was to echo the parameters back, so it was echo %1, echo %2, echo %3 <etc> I think some of the people didn't finish it. <1> shhh <1> not necessary in here this is java <1> which college are you at ? <0> Unitec.ac.nz <1> have you checked out what == and .equals actually do ? <2> ryanstein: When you're learning something, it is a good idea to go and find real resources on things besides your lecture notes. <0> calchas: I'm searching that now. <1> k, shout if you run out of things to read <0> as a guess, == does a compare between strings, .equal compares the value? <1> stop guessing <1> and find out
<3> its only 6mins drive away :) <1> talios, drop a small explosive more likely <0> you must live in mt albert then? <1> ryanstein have you covered much if any OO yet ? <3> ryanstein, ok - 10 minutes - but I've lost my licence once for speeding ;p <3> ryanstein, live in Panmure, work in the CBD <0> the very basics of OO <3> calchas, nah - dont wanna hurt the architecture students there <1> imagine an object with an int and a double as properties <1> what would make 2 objects equal to each other <0> err <2> ryanstein: I gave you a google query to type in before, that explains this. The fact that you're still guessing probably means that you didn't do that google, which suggests that Unitech is not to blame. <0> http://www.geocities.com/technofundo/tech/java/equalhash.html <1> FFS use the grey lump between your own ears for once <1> imagine an object with an int and a double as properties <2> That's largely about implementing equals, not using it. <1> what would make 2 objects equal to each other? <0> listen, I come from PHP programming, object oriented is TOTALLY new to me. <0> don't call me dumb because I don't understand something that I've only just started. <1> can you imagine an object with 2 properties ? <0> to be honest, no. <2> Student with name and address, if you like. <1> I'm not calling you dumb yet, you are looking for too much complexity <0> two attributes, ok. <1> ryanstein can you write a cl*** that has 2 properties (fields/member vars ... ) <1> without worrying about language what would make to objects of that type equal to each other <0> yes <1> as a thought, not a programming exercise <0> multiplying them both? x = x * y, y = x * y ? <1> ok, I give in, you are thick as mince <0> cool <1> if I were you I'd concentrate on learning to serve fast food well <3> where did multiplication come into it? <1> talios is this place a university or a junior school? <3> calchas, officially its now a university, but it -was- just a polytech <1> but it's third level education <1> ? <0> well I've explained that I don't know much about java, how else would I know how to make an int and a double the same, other than specifying int one = 1; double two = 1; <3> yeh <1> ryanstein you don't have 2 braincells joind together, it's a wonder you can type <0> really? <1> yes really <0> <1> without worrying about language what would make to objects of that type equal to each other <1> and to that you drempt up a multiplication <0> [13:27] <0> I'm only 8 weeks into my java module <1> what you do is make random guesses instead of thinking <1> not the behaviour of an intelligent human <0> no what I do is state I don't know java, then wonder why I'm being called dumb because I don't know what you're talking about. <1> but you have had > 10 years maths education right ? <1> that wasn't a java question <0> yet, I'm somehow stupid, if that's true than why am I the one who is NOT resorting to insults? <3> ryanstein, I'll break my rules and give you a big hint to calchas's question "two objects are equal, when each attribute of each object is also equal" <3> no wait - thats an answer. <1> ryan to be honest the first insult was yours, though you don't realise it <0> where? <1> [18:45] <0> multiplying them both? x = x * y, y = x * y ? <1> when you failed to show the respect of thinking
<0> well what else could I say? <1> so insulting you is much more fun than trying to appeal to your mind <0> well I prefer to help people, rather than insult, but I guess that's just me. <1> x = x / y, y = x / y <1> or any number of guesses :) <2> calchas: Calm it down, you just misunderstood calchas some time ago. <2> ryanstein: That was to you. ^^ ;) <1> I missunderstood me ? <2> calchas: If you don't know, nobody else will. <1> see ya Clackwell <2> Nacht, Clackwell. <3> Clackwell, no fair you get to escape <0> what I misunderstand is I don't know HOW to make two number equal to eachother, I left school 14 years ago, any mathematical formula has long since left me. <2> ryanstein: You can't make any two numbers equal to each other, that's a misunderstanding. <2> 5=6 just doesn't happen. <1> not make them equal <1> tell if they are <0> if (x == y) ? <1> object 1 is (5,6.7) and 2 is (5,6.71) <1> are they equal ? <0> depends on the precision of your check <1> ROFL <2> ***ume it's as precise as we can get it. <0> then no. <1> see I was getting worried you were going to be sensible, you really are just dim <1> talios if this is a standard the job market there should be safer :) <0> well sure lets use something just slightly out while trying to explain == and .equals, giving the impression that your whole point is that .equal is more precise than == then laugh and call you a dumb*** when you fall for it. <3> calchas, actually I think it makes it HARDER. BryinAFK / talden / mike2_ and I are all over qualified :) <2> ryanstein: Let's use characters now instead of numbers. <0> rather than (54376540 and (3646) <1> it's not about precision <2> ryanstein: object 1=('a','b'), object 2=('a','d') <2> ryanstein: Equal? <0> no <2> ryanstein: object 1=('a','b'), object 2=('a','b') <2> ryanstein: Equal? <1> what would make them the same ? <0> yes <1> or 'how do you tell' <0> well I think the past 10 minutes of "insult ryanstein" has pretty much shown that I don't know the answer to that. <1> you do because you just did it <3> ryanstein, did you not see me give you the answer? <1> what criteria did you use to make the correct judgements <3> that, and as calchas says - you just did it. <0> I saw talios, but in the middle of the insult-fest I didn't get the chance to let it sink in. <2> ryanstein: When you looked at my examples, how did you know whether the objects were equal? <0> well one object has a b, the other had a d <2> So you effectively looped through and compared each pair of values. <2> ryanstein: That's what String's implementation of the 'equals' method does internally. If you don't call the 'equals' method, you won't get that amazing feature. <0> so .equal compares objects rather than variables? <3> calchas, when we did our last set of interviewing - guess what our simple "coder question" was? "Implement an .equals() method (on paper) for an immutable Integer cl***." ;p <2> If you do if (object1==object2) you are only asking if they are the *same object*. <2> ryanstein: Approximately. <3> calchas, I'm now thinking it wasn't such a stupid test <2> ryanstein: It calls the equals method, which will do different things for different objects, but yes, that's the general upshot. <1> we asked harder computing questions than that when interviewing statisticians <3> heh <2> talios: I'd do public boolean equivalent(ImmutableInteger arg){return getValue()==arg.getValue();}} <0> well thanks for the explanation, but it means nothing. <2> None of this possibly-using-a-default-implementation rubbish. <1> object equality requires a method, and it has to be tailored to a cl***, so for objects .equals is generally used to check for equality of value <1> does that help in any way? <2> ryanstein: String object1=new String("ab"); String object2=new String("ab"); <2> ryanstein: System.out.println(object1==object2); What do you expect? <2> true/false <0> it doesn't explain why if (x == "") doesn't work, but if (x.equals("")); does, because x is a variable. <3> rickety, and you'd fail cause its not an equals(), and you're not taking in an Object :) <1> "" is a reference to an object, whose value is the empty string <2> talios: Then your interview question would be a ridiculous closed question. <0> I would expect it to match. <1> reg <2> ryanstein: Are they the same object as each other? <1> regNum is a reference to a different object whose value is the empty string
Return to
#java or Go to some related
logs:
advantages of NTFS over EXT2 ta lostra teenfreaks #linux i dont wanna wait for our lives to be over chords #chatzone gentoo GAPING_SECURITY_HOLE #chatzone stfu patella #MissKitten
|
|