Anonymous 11:41 and 5:07: Immutable classes do not *require* copy constructors. It's not illegal to have them, but it seems like a waste to me -- so we teach that immutable classes shouldn't have copy constructors. Not sure why java.lang.String would have one.
Just to be sure, for the labtest, is it OK if we use the one true brace style (aka K&R style) instead of the style they made us use in CSE1020 (I think it's Allman style from the wiki page)?
Lots of method writing given a set of specifications. Checks your work as well.
Also, interesting link about the String copy constructor,I guess its extremely useful. Couldn't that usefulness be applied to other immutable classes are well?
On labtest 1, were we supposed to also create the exception object or simply include "throws..." in the method header? Also, were we supposed to check for the number of students not being equal to zero when calculating the average? I didn't think we should as it does not state this as a precondition in the API.. and it also wouldn't make sense for one to want to know the average if there are no students.
LabTest #1 will be held during your regular lab period.
ReplyDeleteit says feb 3 on the Calendar, i am in section M, so my lab is on wednesday.
does that mean i will have the lab test on wednesday?
and also can i get the contant about test 1? what we will be testing on.
What exactly will be the content on the tests?
ReplyDeleteWhat chapters are assigned for labtest and written test? Is it 4,5,6 7, 8.1, 9 or is it just 4,5,6
ReplyDeleteI am curious.. should there be a copy constructor for immutable class as well?
ReplyDeleteI have written down on my lecture notes that immutable classes cannot have a copy constructor.
ReplyDeleteHowever, I see that java.lang.String has a copy constructor, and String is an immutable class.
Can someone please clarify whether immutable class can have copy constructor or not. I am confused?
Anonymous 11:41 and 5:07: Immutable classes do not *require* copy constructors. It's not illegal to have them, but it seems like a waste to me -- so we teach that immutable classes shouldn't have copy constructors. Not sure why java.lang.String would have one.
ReplyDeletehttp://stackoverflow.com/questions/1803271/why-does-java-string-have-a-copy-constructor
ReplyDeleteCould anyone pastebin/email me their code for Lab 3 - I'd like to compare mine to someone elses for mistakes and what not. Thanks
ReplyDeleteJust to be sure, for the labtest, is it OK if we use the one true brace style (aka K&R style) instead of the style they made us use in CSE1020 (I think it's Allman style from the wiki page)?
ReplyDeletehttp://en.wikipedia.org/wiki/Indent_style
In lab 3, would it make sense to make defensive copies of the Date objects given that we provide a mutator to the object anyway?
ReplyDeleteI'm not sure about the Date class? I'm using this.getDay() and it tells me the method is depreciated? How do I fix it?
ReplyDeletehttp://www.codingbat.com/java
ReplyDeleteLots of method writing given a set of specifications. Checks your work as well.
Also, interesting link about the String copy constructor,I guess its extremely useful. Couldn't that usefulness be applied to other immutable classes are well?
1:49: Sure, as long as you pick a style and stick to it.
ReplyDelete2:22: Yes.
3:03: Are you using the custom Date class called for in the lab, or java.util.Date? You shold be using the custom Date.
I have not received any feedback for programming exercises 1, 2, or 3. What is the deal?
ReplyDelete12:49: I thought I finished everybody's feedback last week. Send me an email.
ReplyDeleteAre the cse accounts during the lab tests? I finished within the lab test time is over but I'm still unable to access my account for some reason.
ReplyDeleteYes I didn't get a feedback of my labs as well. Sent you an email as well.
ReplyDeleteOn labtest 1, were we supposed to also create the exception object or simply include "throws..." in the method header? Also, were we supposed to check for the number of students not being equal to zero when calculating the average? I didn't think we should as it does not state this as a precondition in the API.. and it also wouldn't make sense for one to want to know the average if there are no students.
ReplyDeleteThank you!
bro you mad?
ReplyDeletescale of 1-Chris Brown?
ReplyDeleteWill the marks for both the labtest and the written be posted online?
ReplyDelete