some Qs

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2008
Posts: 10
Reputation: xlx16 is an unknown quantity at this point 
Solved Threads: 0
xlx16 xlx16 is offline Offline
Newbie Poster

some Qs

 
0
  #1
Mar 8th, 2009
hi guys i have a couple of Qs.

1.what is javadoc and how it works?

2.what Strong typing means?

3.if we want to control the input ,it is better to use exeption handeling (try chatch),or a single is to control the worng input,
whitch one is faster?

4.look at the code bellow:
try{
//some code }
catch(ArithmaticExeption a){
}
catch(IndexOutOfBoundsExeption a){
}
look the both exeptions have the same name (a),is that right?

when i was reading a book i faced this questions(i have to mention
these are not book`s questions or homework).

thanks alot.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: some Qs

 
1
  #2
Mar 8th, 2009
1.what is javadoc and how it works?

2.what Strong typing means?
My Answer :- STFW

3.if we want to control the input ,it is better to use exeption handeling (try chatch),or a single is to control the worng input,
whitch one is faster?
Exception Handling should be used for only handling "exceptional" situations. What you have mentioned can be done by performing appropriate validations on Input

catch(ArithmaticExeption a){
}
catch(IndexOutOfBoundsExeption a){
}
Yes its perfectly fine to have both variables named "a", because "a" is visible only inside the corresponding catch blocks and not outside of them. It wouldn't have killed you to just compile a program with the above situation, if it was incorrect at most you would have received a compile error.
Last edited by stephen84s; Mar 8th, 2009 at 3:55 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC