Howard Hu

Greenhorn
+ Follow
since Jan 10, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Howard Hu

I wonder how Sun give percentage score.
From my impression, they don't give 90%. Either 89% for 53/59 or 91% for 54/59. They don't round up a 89.8 to 90; instead, they choose int value of raw number. Correct me if I am wrong because I got 53/59 for which I expected 90% but I was given 89%. There was one person who reported 97% before;that also confused me about how sun grade the percentage score.
-Howard
19 years ago
What is the definition of inheritance? Let's put attribute aside,
my feeling is that if subclass does not have that method but superclass has it, you can call that method (if inheritated) from subclass then the method is inherited by the subclass. You can not call it from anywhere other than the super calss itself and subclasses, can you?
Inheritance should not have much/anything to do with polymorphism. It should be a concept of code reuse. Java API has inheritance hierachy; attributes and all the methods shown there are part of inheritrance hierachy. Yes, overriding a static method does not realize late-binding effect but it is concept of polymorphism not inheritance. This is just my personal opinion.
--Howard
Anybody can provide input on how to use jdbc to connect to flat file database? Is jdbc1.0 able to do this? Any comments would be appreciated.
-Howard
First I don't think this type of question will be asked in the real exam.
Second the answer is true.
1/3.0f results in 0.33333334. then timess 3.0f results in 1.00000002xxx and ... you know the answer.
--Howard
I did not see anything wrong with the answer given.

-Howard
19 years ago
I passed Java2 exam today with a score of 89%. As a two-week visitor of JavaRanch, I want to express my appreciation about this site. Although I only posted two questions on this site, I spent time reading some questions and enjoying answering some of them. I spent less than 3 weeks to prepare this test. I did not feel that I was very ready before the test because I have not gone through many mock exams. But my work experience helps me to solve questions of certain areas on which I have not spent enough time. Actually each time when I did a mock test, I did very fast (about 50 mins), I just want to test what I really know and see what is worst situation I could get). I focused my effort on concepts; it is always good to know what you really know and what you don't know. I will continue visiting this site and read the posted questions. Good questions enlighten you a lot.
--Howard
I passed Java2 exam today with a score of 89%. As a two-week visitor of JavaRanch, I want to express my appreciation about this site. Although I only posted two questions on this site, I spent time reading some questions and enjoying answering some of them. I spent less than 3 weeks to prepare this test. I did not feel that I was very ready before the test because I have not gone through many mock exams. But my work experience helps me to solve questions of certain areas on which I have not spent enough time. Actually each time when I did a mock test, I did very fast (about 50 mins), I just want to test what I really know and see what is worst situation I could get). I focused my effort on concepts; it is always good to know what you really know and what you don't know. I will continue visiting this site and read the posted questions. Good questions enlighten you a lot.
--Howard
19 years ago
Should we follow JDK1.2 or JDK1.3?
Can we create a static varible in non-static inner class?
I was told by somebody that you can as long as you define it final. I am not sure about this. For exam, what is correct answer?
--Howard
First one, you can't write super other than the first line.
Second question, your default constructor implicitly calls non-arg super();
Hope this helps. (Ignore my first reply if therw was.)
--Howard
Jane,
Thanks. The issue here is not about whether you can cast an array to an array. It is about one rule in the book talking about casting from a non-final class to an array. I think the discussion so far has made that issue very clear.
--Howard
The best way to answer this question is to run a test program.
Does the real test ask you to differentiate keywords from reserved words? What is the rule to differentiate those two?
Thanks
--Howard
Panajiotis,
Yes, it makes sense. Here is another question related to this.
Object o = new int[10];
Base class Object refers to an array. So now we are able to use subclass's overidding methods and subclass-added methods. What are those method that the object o here can use? What is that subclass definition for an array?
--Howard
why Object can be casted to Object[] but other Class type can not
be casted to array of that class?
Object o = new Object();
Object[] ob = (Object[])o;
MyClass c = new MyClass();
MyClass c[] =(MyClass[]) c;
Howard
Sujit,
I have the same doubt.
RH rule for casting reference:
Oldtype: non-final class & Newtype : Array -> Newtype must be Object
When Newtype is first said as Array, how come the rule is that Newtype must be Object? We are talking about array as new type, not Object! Then we try Object[] as new type, wrong too.
You may argue that an array is an object; but an object of Object type is not always an array. So I think the book should make this more clear.

Howard