What does this mean??

F

freesoft_2000

Hi everyone,

I have two rather silly questions so please bear with me

what does the below code
mean

Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a :
a.getBounds();

Could someone translate the above code into simple java codings so i can
understand it

And finally what does the below code mean

x*= 0.5

Could someone also translate the above code into simple java codings so i
can understand it

I know these quenstions may sound stupid but please bear with me

Thank You

Yours Sincerely

Richard West
 
V

VisionSet

freesoft_2000 said:
Rectangle alloc = (a instanceof Rectangle) ? (Rectangle) a :
a.getBounds();

Could someone translate the above code into simple java codings so i can
understand it

Rectangle alloc ;
if (a instanceof Rectangle) alloc = (Rectangle) a;
else alloc = a.getBounds();
And finally what does the below code mean

x*= 0.5

x = x * 0.5;
 
A

Andrew Thompson

freesoft_2000 said:
I know these quenstions may sound stupid ..

Only because they are. But at least that is a start.
Once you can accurately identify stupid questions,
it will(/should) help you not ask them.
..but please bear with me

What motivation is there to give you the patience
normally reserved for Java noobs, when you fail to
post questions to the group* best suited for those
new to Java/usenet/formulating intelligent questions?

* You should know the group. I have mentioned it to
you on earlier occasions.
 
T

Ted Present

* You should know the group. I have mentioned it to
you on earlier occasions.

As another java "noob," could you tell me what group that might be?

~~Ted Present
 
T

Ted Present

Thanks I'll take a look. I've a bit of java experience, but being
self-taught, there are a few simple things that I often get caught up over.
This group has helped befire, but much of it was way above me.

~~Ted Present
 
S

SteveB

Ted Present said:
Thanks I'll take a look. I've a bit of java experience, but being
self-taught, there are a few simple things that I often get caught up over.
This group has helped befire, but much of it was way above me.
I'm in the same boat.
 
R

Rhino

Andrew Thompson said:
Only because they are. But at least that is a start.
Once you can accurately identify stupid questions,
it will(/should) help you not ask them.
There is nothing "stupid" about his questions. They simply demonstrate his
inexperience with Java. There's nothing stupid about being new to Java; we
were all beginners once.
What motivation is there to give you the patience
normally reserved for Java noobs, when you fail to
post questions to the group* best suited for those
new to Java/usenet/formulating intelligent questions?

* You should know the group. I have mentioned it to
you on earlier occasions.

You appear to have more justification for these remarks. However, I don't
think of comp.lang.java.help as being reserved for "noobs" or those who are
new to Java, Usenet or formulating intelligent questions. I don't consider
myself to fit into any of those categories but I post questions at
comp.lang.java.help occasionally when I want to discuss concepts or design
issues when I have gaps in my OO background, for instance. The atmosphere
seems a bit more patient and tolerant there while comp.lang.java.programmer
sometimes seems frenzied and rude by comparison.

_You_ may want to relegate beginners to that newsgroup but I think it is a
bit presumptious of you to pretend to speak for the entire Java community or
to be the final authority on what belongs in each newsgroup. At any rate,
the fact that a number of people besides myself seem to feel the same way
suggests you do not speak for _us_.

Mind you, I'm not saying there's anything wrong with a newsgroup
specifically for beginners. It just doesn't seem to me that there is a
concensus that comp.lang.java.help is it. It seems to be used for things
other than what you have in mind.

Rhino
 
Z

zero

Thanks I'll take a look. I've a bit of java experience, but being
self-taught, there are a few simple things that I often get caught up
over. This group has helped befire, but much of it was way above me.

This is a programmer-to-programmer group, although a lot of newbies do come
here for questions. If things here go above your head don't get
discouraged. Other groups (like clj.help) might answer in more
understandable terms, but you'll learn more by asking questions there and
lurking here. After a while, things will start to make sense.

And btw most people here don't understand everything either. Everyone has
their speciality, and everyone encounters threads they can't contribute in,
for whatever reason.
 
R

Roedy Green

There is nothing "stupid" about his questions. They simply demonstrate his
inexperience with Java. There's nothing stupid about being new to Java; we
were all beginners once.

The questions are not stupid questions per se. We all had them at one
point, even if it was back in the C days wondering what that strange
notation meant.

They are stupidly inefficient in that they are so basic and so widely
answered in textbooks, that they really should not be asked in an
intermediate newsgroup. Further, they are not particularly mysterious
once explained. It is not as though most people would need any
auxiliary explanation.

It is a bit like an adult asking strangers to spoon feed him his
breakies.

For people with English as a second language, I am more patient. I
don't presume they have access to texts in their own language or that
they can understand the English language explanations. Text book
authors often have a rather unusual way of speaking.

On the other hand, if a low IQ person is determined to learn Java, I
say more power to him. If that person genuinely does not understand,
and has made some effort to understand, I am willing to take time to
explain and explain no matter how much I think the issue SHOULD be
obvious.
 
R

Roedy Green

_You_ may want to relegate beginners to that newsgroup but I think it is a
bit presumptious of you to pretend to speak for the entire Java community or
to be the final authority on what belongs in each newsgroup.

I think there are official charters. There are various descriptions
of the consensus of what the groups are for in various FAQs.

There are people who subscribe to only comp.lang.java. programmer.
They are busy people. They want to stay abreast of what's happening,
but have only a little time to do it. Threads about what *= means are
a total waste of their valuable time.

To them, newbies who is insist on posting to comp.lang.java.programmer
are much like those 90 year old Sunday drivers on the freeway.
 
Z

zero

For people with English as a second language, I am more patient. I
don't presume they have access to texts in their own language or that
they can understand the English language explanations. Text book
authors often have a rather unusual way of speaking.

True.

However, being a non-native English speaker, I have found that translations
are usually worse. Either they are translated by people who know both
languages, but nothing about computers, or by computer-savvy people who
don't have a real translator's skills.
I always found it better to read the original English texts, and IMO
knowledge of English is imperative in computer science.

That being said, I do understand that languages and computers are very
distinct, and not everyone has a grasp on both. I think it's good that
people whose English is less than perfect find their way to usenet and try
their best to explain their problem, and I do try to help.
 
T

Ted Present

zero said:
That being said, I do understand that languages and computers are very
distinct, and not everyone has a grasp on both. I think it's good that
people whose English is less than perfect find their way to Usenet and try
their best to explain their problem, and I do try to help.

I agree. Despite (obviously, as from my earlier posts) being new to this
newsgroup, I've used Usenet for some time and web forums for even longer.
Although people who make honest grammatical/spelling mistakes shouldn't be
shunned (I've done it myself; "teh" instead of "the"), I think that people
who don't care enough to even try writing clearly are the same people who
don't care enough to try working out their own problems.

Posts that look like...
hey can some1 help me i cant get [put problem here] to wrok cause it doesnt
open rite
....probably aren't worth too much time.

However, if the content is still useful to a given community and it can be
deciphered, I've got to hand it to those who take the time to work out an
answer. Maybe posters will learn to write clearer, more relevant posts.

Of course, this thread might have evolved to be a bit OT for this newsgroup
:)
 
D

Dave Glasser

I think there are official charters. There are various descriptions
of the consensus of what the groups are for in various FAQs.

There are people who subscribe to only comp.lang.java. programmer.
They are busy people. They want to stay abreast of what's happening,
but have only a little time to do it. Threads about what *= means are
a total waste of their valuable time.

To them, newbies who is insist on posting to comp.lang.java.programmer
are much like those 90 year old Sunday drivers on the freeway.

I disagree. The aforementioned driver can block the passing lane and
force me to drive slower than I normally would, wasting my time, and
causing me enormous frustration. OTOH, the newbie posting to cljp
wastes virtually none of my time. I can tell within a few seconds
whether or not a post is worth bothering with. If not, I simply ignore
it. No harm no foul.


--
Check out QueryForm, a free, open source, Java/Swing-based
front end for relational databases.

http://qform.sourceforge.net

If you're a musician, check out RPitch Relative Pitch
Ear Training Software.

http://rpitch.sourceforge.net
 
R

Roedy Green

I disagree. The aforementioned driver can block the passing lane and
force me to drive slower than I normally would, wasting my time, and
causing me enormous frustration. OTOH, the newbie posting to cljp
wastes virtually none of my time. I can tell within a few seconds
whether or not a post is worth bothering with. If not, I simply ignore
it. No harm no foul.

Just as people have different reactions to Sunday drivers so do they
to misplaced posts.

There is an advantage to the poster to put it in the proper place
with a distinctive subject line.

If someone later thinks of a solution to the problem, they will find
the thread more easily if it in the right place. If they can't easily
find it, they may give up, and OP will never hear the solution.
 
F

freesoft_2000

Hi everyone,
Only because they are. But at least that is a >start.
Once you can accurately identify stupid >questions,
it will(/should) help you not ask them

I mean seriously andrew everyone has had their share of stupid questions
but i asked that question because i have not done programming for some
time and got rusty.
You should know the group. I have mentioned it >to you on earlier
occasions.

Actually i don't think you did andrew. You told me not to cross post to
other forums(which i did not) but you did not mention to me anything about
this as far as i know

I am trying to get back into programming after many years and i have
gotten abit rusty and hope that you guys won't take my questions as
wasting your time as i have no such intention

Richard West
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top