Originally posted by pradnya phatak:
Please let me know that jcp is having negative marking system?
Originally posted by Shyamsundar Gururaj:
My best guess is ...
In the expression [b]byte b = 127 + 1; , the right hand side (source) gets upgraded to an int and since the destination is a byte and there is no explicit casting, the compiler flags an error. Try byte b = (byte) (127 + 1); ... It'll work fine.
The second expression is pretty obvious. The source does not fit into the destination.
Coming to the third, expressions are not evaluated at compile time. The compiler just checks whether the source can fit into the destination. It does so in this case and the compiler is satisfied. When the expression is actually evaluated, the integer cup overflows and consequently, the odometer is set to the maximum negative integer, -2147483648.
Hope this helps
Shyam
[This message has been edited by Shyamsundar Gururaj (edited September 13, 2001).][/B]
Originally posted by ashok khetan:
hi,
one query---Is it illegal to associate a static class reference with a reference of its enclosing class?( e.g. in the following code)
code:
_____________
public class top {
static class inner {
void show() {
System.out.println("show() in inner");
}
}
public static void main(String []args) {
inner i = new top().new inner();
i.show();
}
}
_____________
Originally posted by Ashish Hareet:
Hi guy's,
I made an Applet on bit shifthing . Plz check it out & let me know. www.geocities.com/gnashes30/bytes
Thanx
Ashish
[This message has been edited by Ashish Hareet (edited September 10, 2001).]
Originally posted by Gagan Indus:
hmmm... i really think tht we CAN get this type of q in exam , coz it seem to test our knowlegde about Object Streams , n transient keyword
( guess if serializable n externlizable are nt [b] expicitly mentioned , still Object stream include them implicitly , no? LOL )
Just try to remember these things , Object streams can "serialize" n thus write-read only those objects which either implement :
-serializable interface ( Contanins no-method )
-or externlizable interface ( contanis only 2 methods wid sig :
public void writeExternal(ObjectOutput oOut) n public void readExternal(ObjectInput oIn)
And memebers wid modifier "transient" are not serialized even if the object implements serilizable
( the above code-ex serialize transient-memebers by explicitly implementing externalizable's method in such a way , externalizable is meant for this purpose , to overrule the default-functionality provided by seralizable )
this shld be enough i guess
[/B]