Click here to Skip to main content
15,909,193 members
Home / Discussions / Java
   

Java

 
AnswerRe: interacting with parent Pin
Nagy Vilmos2-Aug-12 20:40
professionalNagy Vilmos2-Aug-12 20:40 
GeneralRe: interacting with parent Pin
JR2122-Aug-12 21:09
JR2122-Aug-12 21:09 
GeneralRe: interacting with parent Pin
Nagy Vilmos2-Aug-12 21:19
professionalNagy Vilmos2-Aug-12 21:19 
QuestionI want help Pin
Mohammed Kherfan1-Aug-12 22:47
Mohammed Kherfan1-Aug-12 22:47 
AnswerRe: I want help Pin
Andrei Straut1-Aug-12 23:03
Andrei Straut1-Aug-12 23:03 
QuestionThorwing Exception to the calling function from other class Pin
muhammed_k31-Jul-12 23:00
muhammed_k31-Jul-12 23:00 
GeneralRe: Throwing Exception to the calling function from other class Pin
Andrei Straut31-Jul-12 23:38
Andrei Straut31-Jul-12 23:38 
AnswerRe: Thorwing Exception to the calling function from other class Pin
Nagy Vilmos1-Aug-12 20:08
professionalNagy Vilmos1-Aug-12 20:08 
Further to the earlier answer:

0. There are no functions. In the OO world, an object supports methods and, in some cases but not Java, properties.

1. If a class throws an exception it must declare it in it's signature:
Java
void methodName() throws MethodException {
    ...
}


2. An exception is not an error. An exception should be used when you don't know what to do or cannot continue processing. As an example, if you insert a row into a table and it violates a unique constraint then that is an exception. If you try to read a value from a table and it does not exist that is an error.

3. It is advisable to not use an exception to pass results. The choice should be that if an exception is thrown the calling method defaults a result or the called method's return values must include an error range.


Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

GeneralRe: Thorwing Exception to the calling function from other class Pin
muhammed_k2-Aug-12 6:43
muhammed_k2-Aug-12 6:43 
GeneralRe: Thorwing Exception to the calling function from other class Pin
Nagy Vilmos2-Aug-12 20:23
professionalNagy Vilmos2-Aug-12 20:23 
GeneralRe: Thorwing Exception to the calling function from other class Pin
muhammed_k2-Aug-12 21:19
muhammed_k2-Aug-12 21:19 
GeneralRe: Thorwing Exception to the calling function from other class Pin
Nagy Vilmos2-Aug-12 21:48
professionalNagy Vilmos2-Aug-12 21:48 
GeneralRe: Thorwing Exception to the calling function from other class Pin
muhammed_k2-Aug-12 21:55
muhammed_k2-Aug-12 21:55 
Questionaccess data stored in hashset java Pin
ahmadiss31-Jul-12 1:56
ahmadiss31-Jul-12 1:56 
Questionerror when run project jsf2.0 Pin
ahmadiss30-Jul-12 7:14
ahmadiss30-Jul-12 7:14 
AnswerRe: error when run project jsf2.0 Pin
Nagy Vilmos30-Jul-12 23:50
professionalNagy Vilmos30-Jul-12 23:50 
QuestionDesigning to interfaces? Pin
Neo1010129-Jul-12 9:52
Neo1010129-Jul-12 9:52 
AnswerRe: Designing to interfaces? Pin
BobJanova29-Jul-12 23:01
BobJanova29-Jul-12 23:01 
GeneralRe: Designing to interfaces? Pin
Neo1010129-Jul-12 23:48
Neo1010129-Jul-12 23:48 
GeneralRe: Designing to interfaces? Pin
BobJanova30-Jul-12 0:13
BobJanova30-Jul-12 0:13 
AnswerRe: Designing to interfaces? Pin
jschell30-Jul-12 5:54
jschell30-Jul-12 5:54 
Questionhow to convert java code to c# code Pin
LAPEC25-Jul-12 12:55
LAPEC25-Jul-12 12:55 
AnswerRe: how to convert java code to c# code Pin
Paul Conrad25-Jul-12 17:02
professionalPaul Conrad25-Jul-12 17:02 
GeneralRe: how to convert java code to c# code Pin
jschell27-Jul-12 12:04
jschell27-Jul-12 12:04 
GeneralRe: how to convert java code to c# code Pin
Paul Conrad27-Jul-12 14:00
professionalPaul Conrad27-Jul-12 14:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.