| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> regNum is a reference to a different object whose value is the empty string <1> I find this garbage easier to do with graphics. <0> therfore the address of regNum is not the same as "" (if it were they would be the same object) <0> hence regNum == "" returns false <2> being new to OO, I would ***ume you couldn't have two objects that are the same, as it would be like having two apples that were the same, take a bite out of one and the second somehow gets a bite taken out of it. <1> ryanstein: Right, so are the objects the same as each other? <0> but regNum.equals( "" ) looks into the two objects and sees that they are the same and returns true <2> well because I would ***ume you couldn't have two objects that were the same, there'd be no need to compare them. <1> ryanstein: Ok, but the compiler doesn't generally say "no need". <0> an object is a formatted piece on memory if two references are the same address then they both point to the one object <1> ryanstein: What do you expect? <2> no? <1> true/false <1> ryanstein: So what does System.out.println(object1==object2); print? <2> false? <1> ryanstein: Ok. So obviously it doesn't work for testing whether the two objects contains equal values. It only works to see whether they are the same object.
<1> So, based on what we've discussed here, how would you compare the values instead? <1> calchas: I'm not comfortable with /notice or whatever you used, is /msg ok? <2> System.out.println(object1.equals(object2)); <2> .equal I mean. <1> Right first time. <2> yeah <1> calchas: Generally, I don't worry about it too much. I point the students to http://www.leepoint.net/notes-java/data/strings/12stringcomparison.html and they get the idea that .equals is how they compare Strings. <0> as long as you survive I guess the fiorst year exams weed out the worst <1> calchas: One of the unfortunate things with Java is that you have to come across too much before you're ready. I do cover the difference between objects and references, but until they've been doing stuff for a while, it doesn't make complete sense. Reference p***ing from main(String[]) to ActionListener implementations seems to get the notion across. <1> In the things I teach there aren't exams. <0> LOL, or do you still bother with exams <don't answer I'm just being bratish> <1> I don't believe in programming exams that much anyway, I don't think I'd set any. <3> rickety, we did it more just to see their reactions - we had one guy who just refused to do it <3> and one guy who just sat there looking at the paper/pen for 15 minutes <1> I don't teach the CS Java, I teach Multimedia and Internet Technology students, which is a dumbed down CS. Theory isn't important to them. My syllabus scares the guy who teaches 1st year Java, I do this stuff so fast they don't get time to get bored, but it works. <1> talios: Heh. In an interview I took 15 minutes to do some parsing and was pissed off with myself. Someone else started 30 minutes before me and was still struggling. <4> so to reiterate, if (string1 == "") thinks string1 is an object, when it's really a variable and it thinks "" is an object when it's nothing? <1> "" is an object. <1> You can do System.out.println("".length()); <1> if (string1=="") means - is string1 the same object as ""? <0> I never had that issue, I was tortured to machine code and asm, so memory and relative addressing was simple <0> and I did Pascal not Java as a teaching language <0> at least then ADT was at the end not the beginning <0> you surely examing some basic concepts ? <0> writting an app is a practical prject, but knowing what a tree is etc is essay material or simple multiple choice <1> calchas: I don't cover trees, there's no reason to. The main aim is to produce code monkeys. <1> They are aware of this, almost proud of it. <0> are they finding jobs ? <1> If you talk about anything in the abstract, they start daydreaming. That's the nature of their entire degree, I can't hope to change that in one module. <1> I believe so, the UK's not exactly difficult to find code-whore jobs in. <1> monkey, even. <0> the other end of the scale (thinking scientists) is easy for those that retain some practical aspect <1> I'd like to teach those who are interested in theory, probably more than those interested in practice, but it seems unlikely in degree courses. <0> we find it very hard to get candidates and that's not just in CS <0> it's the same in the us <1> I remember studying a module on OOP, and I swear I was the only person who got what the lecturer was talking about. We had to write a UML editor in Java. <1> Ours was the only one that worked, and they made the ***ignment a lot easier the next year. <0> these seem to be the modern analog of the old poly tech vocational qualification <1> Groups of 2. <0> but even less exacting <1> Yes, imo degrees don't deserve to be called degrees. <0> I guess that's what happens when you try to make the entire population attend uni <1> They're commercially driven, and should be named as such. <0> they may have more value under that , but I may be wishing too far <1> Hmm. <1> By the final year, I think there is more value, but by then it's too late. They've missed any nuggets of info from the first two years. <1> Of course, it doesn't help that most teaching staff are rubbish. <3> ryanste^n, what course at Unitech are you doing anyway? <1> I'm going to go to some lengths to get rid of the guy who teaches first year CS Java, on the grounds that he is incompetent, and the main reason that the 1st year has a high dropout rate. <4> Bachelor in Computer Systems <4> Java is required, but I'm not going to continue with programming when this module is finished. <1> ryanste^n: Then you shouldn't be on the module.. <0> btw the idiots that disrupted practicals in my 1st year were warned by the 4th yr tutor and laughed. Someone whispered in the leaders ear (later) that if it ever happened again he personally (involved or not) would have a stairwell accident. We had sensible practicals after that (the stiras were a sweeping wide granite affair waiting to kill someone) <3> I think thats best for everyones sanity. <4> it's required. <1> ryanste^n: It shouldn't be. <1> calchas: I was unfair. The people who turned machines off were visiting Downs' syndrome people. <4> Well it's going to doom the entire cl*** minus about 10 of us who get it. <0> ok <1> There was a big red switch. <4> 75% will fail programming, or more.
<0> ours were going to be 1st year fails <1> ryanste^n: Point to the course notes if they're available online. <4> They aren't. <1> ryanste^n: That's a good indication that they're rubbish. <4> Only their internal net. <0> I've helped out with downs adults, was a lot of fun, controlling them doesn't work, guiding the fun just about does, and it's exhausting <1> calchas: I used to teach a Downs' syndrome girl privately, ballroom dancing. <4> Well I can login, but I'd have to download them, then upload them to my site and I can't be bothered. <1> ryanste^n: doubleplusungood possible copyvio. <5> what is the difference in using setSize versus setPreferredSize? <4> I have give you the week 7 notes <0> the only teacher (I just helped a bit) that had them calm and under control was the music teacher, the combination of music and her (she was a very special human) had them transfixed <4> but they're in .doc and .ppt format. <1> ninlar: setSize sets the size, setPreferredSize sets the size it reports that it would like to be in (overriding the default). <1> ninlar: Practically, neither need to be used usually. <1> ryanste^n: I used to write notes in .doc, then wondered why and stopped. <5> I use netbeans AbsoluteLayout layout manager so sizes are important for me <1> ninlar: Well, that was a bit daft. <5> thx for info <1> Anyway, afaik, AbsoluteLayout should still handle the sizes and you shouldn't. <0> using AbsoluteLayout results in non std hard to share code, as a warning <1> ninlar: http://pastebin.com/650626 <5> yup you're right, looking at the source code it does calculate JFrame size <5> using the controls I put in <1> calchas: You might find that amusing too ^^ <0> did you get a reply? <1> I didn't send it, the student in question printed it out and showed it him. <0> k <1> Apparently he wanted to cover BoxLayout but didn't get time. I'll edit it and send it in a while to reflect that. The student would rather I didn't do that until he has his marks. It could still change for next year. <1> For now it's annoying me in my gmail drafts. ;) <4> I'm using a try and catch to read an int from my input to try and stop my program crashing when a string is entered (no idea if this will work, I'm just trying it) but I'm getting an error that doesn't make sense: Error: exception java.io.IOException is never thrown in body of corresponding try statement <4> Can someone help? <1> ryanste^n: What method are you calling that can throw an exception? <3> catch a different exception? <0> you are catching the wrong exception <0> what exception did you get? <4> yearOfMan = input.nextInt(); <4> InputMismatchException: <0> catch that exception <4> so would that be ex? <1> Any identifier. <4> well I'm using catch (IOException e) { <0> try { ... } catch( InputMismatchException myException ) { <0> not IOException, it isn't thrown <4> oh <1> What's IOException got to do, got to do with it? <0> probably coppied from other code <3> damn those second hand emotions <6> anyone used properJavaRDP ? <0> never heard of it <0> what is it? <6> http://properjavardp.sourceforge.net/ <6> i want to use it in my website, but i don't know how <6> i know it is posibble <0> ta <6> ta? <0> ta is uk short and friendly for thank-you <6> can you help me out with this? <0> it's taught to children as it's easier than thankyou to start, then it's used as a friendly version later, somewhat region specific <0> maybe a little <6> ta <0> what do you want it on your web sirte for? <6> accessing the computer <0> for anyone ? <6> no <0> why on your web then <6> for mr <6> me <0> ok <0> it doesn't look like an applet <6> i have seen in another website <6> so i know it is posibble <4> Ok, I thought with a try and catch I could catch an error, fix the problem and my program could keep going, but instead it performs the catch and the next line of code, then crashes, is this what it's supposed to do? I was trying to catch an error from entering a string instead of an int in my scanner.
Return to
#java or Go to some related
logs:
JavaPos Usage Lib Firefox textarea selectionEnd scrollbar my father beat your father at dominos Metlek hacker #windows reprezentanti avon mrfunpants apache 2.0.55 AddHandler ignored What Indian tribe defeated Custer at the Battle of Little Big Horn ? evrofutbal
|
|