Lately, it seems like a lot of people are receiving really bad basic Java instruction. Maybe it's just me, but it seems like there's been a jump recently in questions like this one, or "What's better, String or StringBuffer?" as if they were completely interchangeable (in fact, over at JavaRanch, that exact question seems to be posted about once a week.) These same incompetent teachers are still telling their hapless students to use StringBuffer, Vector and Hashtable, as if Java had stopped evolving at version 1.1. One might almost suspect a conspiracy...
> Lately, it seems like a lot of people are receiving
> really bad basic Java instruction. Maybe it's just
> me, but it seems like there's been a jump recently in
> questions like this one, or "What's better, String or
> StringBuffer?" as if they were completely
> interchangeable (in fact, over at JavaRanch, that
> exact question seems to be posted about once a week.)
My eyes about popped out of my head a week or so ago when I saw here, roughly, "Which is better, interface or switch?"
> > My eyes about popped out of my head a week or so
> ago
> > when I saw here, roughly, "Which is better,
> interface
> > or switch?"
>
> Okay, Mr. Smarty Man, so which one is better, if you
> think you know so much?
Mauve has the most RAM. Duh.
> I want to say, how string is immutable?what makes it
> immutable?
Q:Why do airplanes fly?
A:Because it was designed to fly.
Q:Why do ships float on water?
A:Because it was designed to float on water.
Q:Why do you ask such pathetic questions?
A:Well even i don't have an answer for this.
> > I want to say, how string is immutable?what makes
> it
> > immutable?
>
> Q:Why do airplanes fly?
> A:Because it was designed to fly.
>
> Q:Why do ships float on water?
> A:Because it was designed to float on water.
>
> Q:Why do you ask such pathetic questions?
> A:Well even i don't have an answer for this.
No matter how I love a good troll bashing, this makes no sense. You cannot answer every question with "because it was designed so". An airplane flies because of the pressure difference under and over the wing (I think :)) So it obviously *has* a reason. Sun having designed immutable strings, probably has a reason (Answers to be found everywhere)
> Just making a class final, can we be able to make it
> immutable?
No, making a class final makes it impossible to create a subclass of this class.
> if we r designing an interface, we can be
> able to change the functionality of the methods in it
An interface has methods, but does not contain the implementation.
> ...so how can we able to make our own class immutable?
Make sure the fields are private, there are no setters, and the getters returns copies/clones of the values.
> > > I want to say, how string is immutable?what
> makes
> > it
> > > immutable?
> >
> > Q:Why do airplanes fly?
> > A:Because it was designed to fly.
> >
> > Q:Why do ships float on water?
> > A:Because it was designed to float on
> water.
> >
> > Q:Why do you ask such pathetic questions?
> > A:Well even i don't have an answer for
> this.
>
> No matter how I love a good troll bashing, this makes
> no sense. You cannot answer every question with
> "because it was designed so". An airplane flies
> because of the pressure difference under and over the
> wing (I think :)) So it obviously *has* a reason. Sun
> having designed immutable strings, probably has a
> reason (Answers to be found everywhere)
Please care to read what i have quoted.The question which i have quoted is "I want to say, how string is immutable?what makes it immutable?"
He's not asking here why strings are immutable.Hes asking some **** like what makes it immutable?Now how much sense does that make?
> He's not asking here why strings are immutable.Hes
> asking some **** like what makes it immutable?Now how
> much sense does that make?
It's a perfectly valid question. It's also a good reason for the OP to refrain from [url=http://forum.java.sun.com/thread.jspa?threadID=5133944]trying to tackle J2EE applications[/url] until s/he has a good understanding of the fundamentals.
~
> > An airplane flies because of the pressure
> difference
> > under and over the wing (I think :))
>
> Actually it flies because it pushes air downward (and
> Newton takes care of the rest :) ).
Isn't that because of the pressure difference?
> Actually it flies because it pushes air downward (and
> Newton takes care of the rest :) ).
Reduced pressure on the upper wing surface provides lift, i.e., increased upward pressure on the underside of the wing. How are you understanding that an airplane wing pushes air downward?
[EDIT] I googled and found the "Coanda effect". Disregard my previous question. :o)
~
> ...so how can we able to make our own class immutable?
1. Don't provide any methods that modify the object (mutators)
2. Ensure that no methods may be overridden
3. Make all fields final
4. Make all fields private
5. Ensure exclusive access to any mutable components
I hate to bump a pointless thread, but something has always bugged the hell out of me.
Why is it all noobs to this forum use "u", "r", "n", etc. in place or "you", "are", "and", etc., respectively? This happens often when people post their homework from college or AP Computer Science courses.
Why do people in AP courses or in college courses feel the need to type "u", "r", etc.? Do they not realize how retarded it makes them look?
Has anyone here ever typed like that? I must admit, I used to when I was TWELVE. Then, when I was about 12 1/2, I realized how utterly absurd it is.
So, I guess my question is: WHY?
That cannot be answered, can it?
> Ironic, coming from you questie. You're one of the
> most pathetic question asker I've ever encountered
> around here.
I don't remember asking questions here at the forum other than asking reviews about the books i would want to buy?Now stop tailing me for christs sake.
> > Ironic, coming from you questie. You're one of the
> > most pathetic question asker I've ever encountered
> > around here.
>
> I don't remember asking questions here at the forum
> other than asking reviews about the books i would
> want to buy?Now stop tailing me for christs sake.
Sorry Quest, but I thought the same thing as warnerja did when I read that. To be honest you have been a pain with the questions you asked in the past. Lately you have been attempting to help, but at first you appeared to be a troll with an attitude.
> Sorry Quest, but I thought the same thing as warnerja
> did when I read that. To be honest you have been a
> pain with the questions you asked in the past.
> Lately you have been attempting to help, but at
> first you appeared to be a troll with an attitude.
Quest,
Also, I don't think I am the only one that feels this way. Have you forgotten how you originally acted?
Take a look at reply #19 here:
http://forum.java.sun.com/thread.jspa?forumID=54&threadID=792419
> Sorry Quest, but I thought the same thing as warnerja
> did when I read that. To be honest you have been a
> pain with the questions you asked in the past.
> Lately you have been attempting to help, but at
> first you appeared to be a troll with an attitude.
The only time i remember getting involved in a question was the one on multithreading and that too involving only jverd.Oh ya and one on suns implementation of interfaces and after that a lot on books and initially a few altercations.But that was at the beginning.Even i consider myself a troll when i think of the way i was then.But now it's warner who's trying to pick a quarrel with me everytime.Keep up the good work warner while i enjoy ignoring you.
> The only time i remember getting involved in a
> question was the one on multithreading and that too
> involving only jverd.Oh ya and one on suns
> implementation of interfaces and after that a lot on
> books and initially a few altercations.But that was
> at the beginning.Even i consider myself a troll when
> i think of the way i was then.But now it's warner
> who's trying to pick a quarrel with me everytime.Keep
> up the good work warner while i enjoy ignoring you.
I did point out that your behavior has changed. However, you have to realize that the bad taste your first impression left in our mouths will take a while to go away. (Assuming you don't go back to trolling).
> > Sorry Quest, but I thought the same thing as
> warnerja
> > did when I read that. To be honest you have been
> a
> > pain with the questions you asked in the past.
> > Lately you have been attempting to help, but at
> > first you appeared to be a troll with an
> attitude.
>
> Quest,
>
> Also, I don't think I am the only one that feels this
> way. Have you forgotten how you originally acted?
>
> Take a look at reply #19 here:
>
> http://forum.java.sun.com/thread.jspa?forumID=54&threa
> dID=792419
As i just to told you i don't disagree with the rest and infact i considered myself a troll then.But i have put all those things behind my back.
> > > It appears the message is getting through to you
> > > afterall. Good.
> >
> > Which message are you talking about?
>
> Everything you claim to have been ignoring.
Whatever.Catch me sometime else.And to get to your notice you can't provoke even the hell out of me to get involved in any altercation with you.