Anthea Blake

Greenhorn
+ Follow
since Apr 18, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anthea Blake

Thanks for your help.
I disabled the jdk 2 v1 option in the internet options and everything works fine now.
Thanks again. :-D
22 years ago
Hi,
I am using Microsoft IE 5.0
Thanks
22 years ago
Hi,
I am runnung MS Windows 2000 Professional Ed.
I have JDK 1.3 installed
Thanks,
Anthea
22 years ago
Hi,
I am trying to run the "Round Up" program but I keep getting a class not found error while it tries to load the applet.
Can you please give me some suggestions as to how I can fix this problem.
Thanks,
Anthea
22 years ago
Thanks for your reply.
So does it mean that in the case.
C1 = (char)(C1+1), is (C1+1) evaluated to and integer and then cast down to a Character.? If this is the case, when is downcasting permitted and when is it not.?
Hi,
Sorry... the line numbers are 8 and 9 not 9 and 10.
Thanks,
Hi,
Can anyone please tell me why line 9 gives an error but line 10 doesn't. Isn't C1+=1 the same as C1=C1+1?
The explaination for the answer is:
"We can apply ++ operator on char values it will do increament on its ascii value i.e. it will make A to B.We can also apply += operator as it also do implicit casting.But the statement "c1=c1+1" is not valid as we required casting to store an int value into a variable of type char".
But I don't see why... it is that on line 9 the number 1 is converted to a character and on line 10 C1 is converted to an integer? If the number 1 on line 9 is an interger, is it possible to implicitly convert it to a character, so that it can be stored in C1 which is defined as a char?

1 class Char
2 {
3 public static void main(String arg[])
4 {
5 char c1,c2;
6 c1='A';
7 c1++;
8 c1+=1;
9 c1=c1+1;
10 c2='B';
11 c2--;
12 c2=c2-1;
13 }
14 }
Thanks,
Thanks I thought that
Parent p = new Child()
Child c = p
would work, but I re-read Corey's explaination and found that the above code would not work because c expects a child or subclass of child and even though p points to a child, it is not a child itself, therefore a cast is needed to make p a child before assigning it to c.
Thank you very much for your help. Thank you also for your rules that you supplied, its a great help.
Thanks again,
Thank you very much for your replies.
One quick question though... in Corey's example, if I say
Parent p = new Child()
am I not making p a child? So then why is
Child c = (Child)p necessary?
Thanks again,
Hi,
Thanks,...
Can I make a child a parent though, through a cast, or cast a parent as a child?. I always seem to run into problems with these type of questions.
Thanks for your help.
Hi,
If the evaluation ends up as true, shouldnt x=1 because you increment x?
I understand that because it says x++ and not ++x, the original value x=0 is assigned to x but seeing that it is printed on the next line, and there is only one var x, won't x be incremented by the time the println statement is executed?
Thanks,
Hi,
Does anyone know of a simple way that I can understand when casting is legal or illegal when it relates to assignment of Classes, Sub-Classes, and intefaces.
I always seem to understand the concept when i read a java book, but when i do an actual question I either get it wrong or sit forever trying to figure it out. Sometimes I get the answer correct, but I still don't feel too comfortable that I understand it.
Is there a website that I can go to that will explain this to me in simple terms. I found a link in this forum that explains bit shifting really well, which uses cats and mice, and now I FINALLY understand how it works.
If I could find a site like this or similar, to explain casting between classes, subclasses and interfaces, it would be really great.
Thanks
Anthea. :roll:
Okay.. Thanks.. I'll see how it goes with the sample exams.
Thanks again,
Thanks...
I guess it all comes down to making sure you know your stuff before you rule out any answer. :-)
Thanks again,
Hi,
Does anyone have some advice as to how I should answer a question on the exam?
Should I first read the question and the code, then the answers, or should I read the questions, the answers and then read the code to eliminate the multiple choice answers as I go along.
THis may seem like a stupid question, but I always seem to have a problem with running out of time when the code that accompanies the questions is really long.
Any advice will be great.
Thanks,
Anthea.