Weij Yin

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

Recent posts by Weij Yin

Hi there,

I couldn't find the place I can ask the questions related to AspectJ. Anyone can help me out?

Weij
20 years ago
Hi there,

I couldn't find the place I can ask the questions related to AspectJ. Anyone can help me out?

Weij
20 years ago
Hi there,

I couldn't find the place I can ask the questions related to AspectJ. Anyone can help me out?

Weij
20 years ago
Hi there,

I couldn't find the place I can ask the questions related to AspectJ. Anyone can help me out?

Weij
Hi there,

I couldn't find the place I can ask the questions related to AspectJ. Anyone can help me out?

Weij
Hi all,

It may be useful for determining the result when using "=="......

Operator | Operand types | Operation performed
------------------------------------------------------------
== | primitive, primitive | equal(have identical values)
== | reference, reference | equal(refer to same object)

Weij
20 years ago

However, if you look at the method main(), I have not declared throws. But, still I am able to use stmt "throw new SimpleException ()",
with no exception or issues. I wonder why ?. Please help me to understand.



That is, because you use statement "throw new SimpleException()" in the block of try, and also the block of the exception catch catchs the exception, SimpleException. If the stmt is used outside the try block, you have to write "public static void main (String []args) throws SimpleException". In this situation, SimpleException will be handled by the Java VM.

Weij
20 years ago

is it necessary for validation?



java.io.Serializable is an interface that is entirely empty. A class can implement this interface simply by naming it in its implement clause without having to implement any methods. This technology is a useful way to provide additional imformation about an object, and it does not affect the normal operation on an object.

java.lang.Cloneable is another such interface. It defines no method, but identifies the class as one that allows its internal state to be cloned by the clone()method of the Object class. For example:


Object o;
Object copy;
if(o instanceof Cloneable) copy = o.clone();
else copy = null;


Now, let's come back to java.io.Serializable interface. A class should implement this interface simply to indicate that it allows itself to be serialized and deserialized with ObjectOutputStream.writeObject() and ObjectInputStream.readObject(). In other words, the class should be converted into a stream of bytes that can later be deserialized back into a copy of the original object. When to use it? in the area of network programming and distributed programming, because they have issues such as delivery delay, difference of systems, and network failing.

Regards,
Weij
20 years ago

If you extend Throwable, then your type can't be caught generically without also catching junk like OutOfMemoryError at the same time.



Hi Ernest,
Thanks for a good explanation from Jess and you. But I do not have a clear understand on your words obove. Could you explain a little more? Thanks in advance.

Weij
20 years ago