Q4) Which of the following statement(s) are not true about JavaBeans?
* a) JavaBeans implements java.io.serializable interface. * b) JavaBeans provides no argument constructor. * c) JavaBeans provides getter and setter method for accessing its properties. * d) JavaBeans class can contain public instance variable. * e) None of the above
My answer: b,c? Their answer: a,d
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Jeffry Kristianto Yanuar
Ranch Hand
Joined: Oct 01, 2007
Posts: 759
posted
0
Of course their answer is true. JavaBeans cannot has public instance variable, they must be encapsulated. and JavaBeans doesn't implements java.io.Serializable. It is SCJP question isn't it?
I am confused too. There got to be some reason behind it. Either the question is not put in correctly or the answer to the question is misleading. Need some experienced input here .... Anybody??? [ August 06, 2008: Message edited by: Asif ]
Read the section describing persistence to learn more.
Enjoy!
..Which confirms that JavaBeans implements the java.io.serializable interface, so the set answer is worng as by selecting it they suggest that JavaBeans do not implement the serialieable interface!
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
...and also confirms that any non-Sun Microsystems technical documentation or "mock exam site" may contain incorrect information.
Mock at your own risk
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.