Users\Yucca\Documents\NetBeansProjects\SCJD\src\suncertify\db>j
Contractor.java
tractor.java:28: as of release 1.4, 'assert' is a keyword, and
s an identifier
e -source 1.3 or lower to use 'assert' as an identifier)
assert MAGIC_COOKIE == new DBExtract().getMagic() :"agic cooki
^
tractor.java:28: ';' expected
assert MAGIC_COOKIE == new DBExtract().getMagic() :"agic cooki
^
tractor.java:28: invalid method declaration; return type requir
assert MAGIC_COOKIE == new DBExtract().getMagic() :"agic cooki
^
tractor.java:28: ';' expected
assert MAGIC_COOKIE == new DBExtract().getMagic() :"agic cooki
^
rrors
Users\Yucca\Documents\NetBeansProjects\SCJD\src\suncertify\db>
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Roel De Nijs wrote:what's the purpose using those assertions because that's not clear to me? you make an assert for checking the magic cookie, what are you trying to achieve with that check?
if i run your code and select a data-file with another magic cookie, what do you expect to happen? if you want user to be notified that he selected a wrong data-file and give him another try to select data file. when you use asserts, an assertionerror is thrown (which you are not intended to catch). if i run your program without enabling them, i don't know what will happen on the code you posted
in my code: i open file, check the magic cookie and if it's not the same i throw an DatabaseException (a runtime exception) with message "data file invalid" which i then can catch and give the user the opportunity to choose some other file
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |