Help coderanch get a
new server
by contributing to the fundraiser

anilkuj

Greenhorn
+ Follow
since Sep 18, 2000
Merit badge: grant badges
For More
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 anilkuj

d1=-1.0;
d2=0;
byte b=0;
b=(byte)d1/d2;
System.out.println(b);


here the value of b is o.

d1=1.0;
d2=0;
byte b=0;
b=(byte)d1/d2;
System.out.println(b);

here the value of b is -1.

d1=0.0;
d2=0;
byte b=0;
b=(byte)d1/d2;
System.out.println(b);

here the value of b is 0 again.


Anybody explain these resulsts and give me the exact bit rep. of +ive infinity, -ive infinty, and NAN.I am totally confused.

Thanx

aNiL
[ May 21, 2005: Message edited by: Barry Gaunt ]
Hi william
yes i got it i understood i thought over it after i posted the reply. Thanx a lot.
aNiL
Hi William ,
Ok the first part was clear but i am still not able to understand how the compiler is able at accept the same char. literal inside /* and */.
Thanx
aNiL
yeah you must be right even i feel thatis the only possibility
Thanx
aNiL
hi NM,
you can just fill in the details after a few mts you get a mail in which the username and pwd is sent , if that doesn't works mail me i can give you my id and pwd my id is janil@in.ibm.com
See u
aNiL
hey guyz
if any of you get hold of it pass it on to janil@in.ibm.com
Thanx
aNiL
hi kumares!
what the question is asking is what should the cat class include as member variable sto complete the defn. according to the defn. the extra features of th cat class other that what define in pet class are E,F
D is not possible since in Cat MyCat , u r instantiating the class cat which ic not necessary to be the memeber var. according to the defn.
hope that's clear, any more clarificationc always welcome
Thanx
aNiL
hi vidya !
default is used in switch statement where in none of the cases match whatever is written in the default case will execute.
is that ok
aNiL
does that mean that the inner interface is independent of outer interface except for the accessibility
aNiL
sorry in the above reply i made a mistake which i have corrected and shown in quotes below
hi rahul
what u say is perfectly right what doubt i still have is when i implement a interface why do i need not give any body "for method in b which is inside a" is it b'coz b is static implicitly but still that doesn't explain why i need not give any body for amethod inside b.
Thanx
aNiL
hi bala
that was a good exp. even i was facing the same problem now i understood why it was behaving so strange
but i have another prob. related to this just check out my posting subject "this is really amazing....."
Thanx
aNiL
hi rahul
what u say is perfectly right what doubt i still have is when i implement a interface why do i need not give any body for b which is inside b is it b'coz b is static implicitly but still that doesn't explain why i need not give any body for amethod inside b.
Thanx
aNiL
hi! sunitha
Then how does this compile?
class a
{
//char a='\u0009';
}
BTW my question actually was why it is checking the syntax even thoudgh i comment it with // but its not doing so for /* and
*/ type of comment.
Thanx
aNiL


class a
{
//char a='\u000a';
}

The above code doesn't compile it throws 2 errors, why is that if that's not enough take this
class a
{
/*char a='\u000a';*/
}

this code ecompiles perfectly without any poblems anybody pls
explain this
Thanx
aNiL
hi Ramani,
This is from JLS 2.0,
9.4.1 Inheritance and Overriding
If the interface declares a method, then the declaration of that method is said to override any and all methods with the same signature in the superinterfaces of the interface.
If a method declaration in an interface overrides the declaration of a method in another interface, a compile-time error occurs if the methods have different return types or if one has a return type and the other is void. Moreover, a method declaration must not have a throws clause that conflicts (�8.4.4) with that of any method that it overrides; otherwise, a compile-time error occurs.
So according to that when the method is overriden it can always drop the exception without any problem.I hope that clears your problem
See U
Anil