|
Authored by: Gringo_ on Friday, May 04 2012 @ 11:29 AM EDT |
"If Google replaced java.lang.String with google.lingo.Word
I could still write java thus:
google.lingo.Word myWord = new google.lingo.Word("Hello");"
No you could not! You could not "still write Java". There
would be no Java. You are suggesting changing one thing, but
the question does not ask if you can change one thing. Why
do you persist in this?
[ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Friday, May 04 2012 @ 11:49 AM EDT |
There are two problems here. The first is that your answer
is probably wrong, but it's hard to see that because the
Judge's question is incomplete - which is the major problem
with it. The wording doesn't include an explanation of what
Google is trying to achieve. So it'd be like saying "Can I
replace a house with a car"?
"Your" (ok, I'm being mean, don't take it personally!)
answer: "Of course! They're both physical objects!"
The right answer: "WTH? I can't live in f***ing car! No
way!"
Google had certain aims in writing Android that are entirely
legitimate, and would not be achieved by renaming random
Java classes.
The second problem with your comment is that you picked the
wrong example. No, not even if Google could achieve the same
ends by replacing, say, java.io.Writer with
google.comms.OutputStuff, can you replace java.lang.String
with anything else.
Why?
Because string literals in Java (ie things in double quotes,
like the argument for out.println("This is what I'm talking
about");) are defined as java.lang.String (or a superclass
thereof.) Java without java.lang.String is not Java.
java.lang.String occupies a special place in the language
definition itself.
Does that make sense?
[ Reply to This | Parent | # ]
|
|
Authored by: bprice on Saturday, May 05 2012 @ 01:19 AM EDT |
If Google replaced java.lang.String with google.lingo.Word I could
still write
java thus:
google.lingo.Word myWord = new
google.lingo.Word("Hello");
No. This would require a
constructor like google.ling.Word(java.lang.String word)
...
because "Hello" is defined, in the language, as
an instance-object of the java.lang.String class. Unless the compiler
is broken, it must and will adhere to that requirement. You cannot replace
all java.lang.String references by google.lingo.Word,
and still have a Javatm.
--- --Bill. NAL: question the
answers, especially mine. [ Reply to This | Parent | # ]
|
|
|
|
|