Click here to Skip to main content
15,914,163 members
Home / Discussions / Java
   

Java

 
GeneralRe: How to interact with MS Outlook Exchange in Java? Pin
Richard MacCutchan28-Oct-10 1:26
mveRichard MacCutchan28-Oct-10 1:26 
GeneralRe: How to interact with MS Outlook Exchange in Java? Pin
pcphuc28-Oct-10 16:32
pcphuc28-Oct-10 16:32 
QuestionUse of Assert Pin
vidhyaej27-Oct-10 2:03
vidhyaej27-Oct-10 2:03 
AnswerRe: Use of Assert Pin
Nagy Vilmos27-Oct-10 2:37
professionalNagy Vilmos27-Oct-10 2:37 
GeneralRe: Use of Assert Pin
vidhyaej27-Oct-10 19:53
vidhyaej27-Oct-10 19:53 
GeneralRe: Use of Assert Pin
Gerben Jongerius27-Oct-10 20:34
Gerben Jongerius27-Oct-10 20:34 
GeneralRe: Use of Assert Pin
Peter_in_278027-Oct-10 21:07
professionalPeter_in_278027-Oct-10 21:07 
AnswerRe: Use of Assert Pin
naief1-Dec-10 8:18
naief1-Dec-10 8:18 
try this
boolean rankToString(ACE) == "Ace";
boolean rankToString(DEUCE) == "Deuce";
assert rankToString(ACE) == "Ace";
assert rankToString(DEUCE) == "Deuce";

for more information read this page

exactly this paragraph
"Do not use assertions to do any work that your application requires for correct operation.

Because assertions may be disabled, programs must not assume that the boolean expression contained in an assertion will be evaluated. Violating this rule has dire consequences. For example, suppose you wanted to remove all of the null elements from a list names, and knew that the list contained one or more nulls. It would be wrong to do this:
// Broken! - action is contained in assertion<br />
    assert names.remove(null);



The program would work fine when asserts were enabled, but would fail when they were disabled, as it would no longer remove the null elements from the list. The correct idiom is to perform the action before the assertion and then assert that the action succeeded:
// Fixed - action precedes assertion
    boolean nullsRemoved = names.remove(null);
    assert nullsRemoved;  // Runs whether or not asserts are enabled



As a rule, the expressions contained in assertions should be free of side effects: evaluating the expression should not affect any state that is visible after the evaluation is complete. One exception to this rule is that assertions can modify state that is used only from within other assertions. An idiom that makes use of this exception is presented later in this document. "
Questionmathematical symbol Pin
pipu12326-Oct-10 22:58
pipu12326-Oct-10 22:58 
AnswerRe: mathematical symbol Pin
Richard MacCutchan27-Oct-10 2:55
mveRichard MacCutchan27-Oct-10 2:55 
GeneralRe: mathematical symbol Pin
pipu12327-Oct-10 4:53
pipu12327-Oct-10 4:53 
GeneralRe: mathematical symbol Pin
Richard MacCutchan27-Oct-10 5:27
mveRichard MacCutchan27-Oct-10 5:27 
GeneralRe: mathematical symbol Pin
David Skelly27-Oct-10 22:32
David Skelly27-Oct-10 22:32 
QuestionJava Interface Componants Pin
kanishka_300026-Oct-10 19:36
kanishka_300026-Oct-10 19:36 
AnswerRe: Java Interface Componants Pin
Richard MacCutchan26-Oct-10 22:13
mveRichard MacCutchan26-Oct-10 22:13 
GeneralRe: Java Interface Componants Pin
kanishka_300027-Oct-10 2:30
kanishka_300027-Oct-10 2:30 
GeneralRe: Java Interface Componants Pin
Richard MacCutchan27-Oct-10 2:37
mveRichard MacCutchan27-Oct-10 2:37 
Questioncoding for implementing antivirus software [modified] Pin
kulbhushan125-Oct-10 1:16
kulbhushan125-Oct-10 1:16 
AnswerRe: coding for implementing antivirus software Pin
Cedric Moonen25-Oct-10 1:37
Cedric Moonen25-Oct-10 1:37 
QuestionPassing Parameters in Methods Pin
vidhyaej25-Oct-10 0:25
vidhyaej25-Oct-10 0:25 
AnswerRe: Passing Parameters in Methods Pin
Alok Sharma ji25-Oct-10 0:46
Alok Sharma ji25-Oct-10 0:46 
GeneralRe: Passing Parameters in Methods Pin
vidhyaej25-Oct-10 2:08
vidhyaej25-Oct-10 2:08 
GeneralRe: Passing Parameters in Methods Pin
Gerben Jongerius25-Oct-10 3:03
Gerben Jongerius25-Oct-10 3:03 
AnswerRe: Passing Parameters in Methods Pin
Richard MacCutchan25-Oct-10 6:16
mveRichard MacCutchan25-Oct-10 6:16 
QuestionHow to capture image via web cam and display in JAVA/JSP/Servlet Pin
Alok Sharma ji24-Oct-10 23:38
Alok Sharma ji24-Oct-10 23:38 

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.