Results 1 to 2 of 2
  1. #1
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default How to report the error message in certain situations?

    How to report the error message in certain situations?

    For example, if user type x<3, I want to print something and break the program. Is there any convenient ways or I should rely on break and System.out.print?

    Many thanks!

  2. #2
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    5

    Default

    Look into throwing exceptions and then testing for the break condition using a try catch block.
    Sun tutorials: Throwing exceptions

Similar Threads

  1. Error Message????
    By Cubba27 in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 02:46 PM
  2. Error With Sql And Jasper Report
    By Heather in forum JDBC
    Replies: 4
    Last Post: 12-03-2008, 11:31 AM
  3. Tomcat5.5 error report
    By jithan in forum Java Servlet
    Replies: 1
    Last Post: 07-18-2008, 04:58 PM
  4. java error message
    By baileyr in forum New To Java
    Replies: 2
    Last Post: 01-23-2008, 03:47 AM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 02:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •