The moose likes Beginning Java and the fly likes Whether System is Serializable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Whether System is Serializable" Watch "Whether System is Serializable" New topic
Author

Whether System is Serializable

Martin Jansen
Greenhorn

Joined: Oct 22, 2010
Posts: 9
I have a question about the Sharpen your pencil exercise of Head First Java 2nd Edition, page 465: is object type System serializable? I think not, because it cannot be instantiated and it has some methods with stream objects so it is already serialized. But if this is not the right answer i like to hear from you!
Because i learn Java by selfstudy and using the Head First Java book, i cannot ask a teacher to explain this.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 26713
Please consider where to post, and don't add a new question to an existing topic. I am not sure I understand your question, but it can probably be answered easily by looking up the class in the API documentation.
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

Only instances can be serializable, and java.lang.System cannot be instantiated.

Also, a major indicator of whether a class is serializable or not, is by checking if it (directly or through some super class) implements java.io.Serializable.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Martin Jansen
Greenhorn

Joined: Oct 22, 2010
Posts: 9
Only instances can be serializable, and java.lang.System cannot be instantiated.

--> That's what i also thought, so thank your for thinking with me!

Also, a major indicator of whether a class is serializable or not, is by checking if it (directly or through some super class) implements java.io.Serializable

--> In the API i see the System class don't implements java.io.Serializable.

Question is answered!
 
 
subject: Whether System is Serializable
 
Threads others viewed
Java 5 - books (not necessarily certification ones)
Books that should be made into movies
Cleared SCWCD with 88%
Can people recommend some books for the absolute beginner?
Error: Exeption in thread "main" java.lang.NoSuchMethodError: main
IntelliJ Java IDE