Thread: what's wrong?

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    0
    Rep Power
    0

    what's wrong?


    public class TestCatch
    {
    public static void main(String arg[])
    {
    Integer index = null;

    try
    {
    System.out.println("Try" + (index.parseInt(arg[0])) / (index.parseInt(args[1])));
    System.out.println("have no Exception");
    }

    catch(IndexOutOfBoundsException IE)
    {
    System.out.println("IndexOutOfBoundsException");
    E.printStackTrace();
    }

    catch(ArithmeticException AE)
    {
    System.out.println("ArithmeticException");
    E.printStackTrace();
    }

    }
    }
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Amersfoort, The Netherlands
    Posts
    10
    Rep Power
    0
    More info please

    - What is the error you encounter?
    - What doesn't work

    Erwin
  4. #3
  5. Golden Member =p
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Final Frontier
    Posts
    9
    Rep Power
    0
    try :

    class TestCatch {
    public static void main(String arg[]) {
    Integer index = null;

    try
    {
    System.out.println("Try" + (index.parseInt(arg[0])) / (index.parseInt(args[1])));
    System.out.println("have no Exception");
    }

    catch(IndexOutOfBoundsException IE)
    {
    System.out.println("IndexOutOfBoundsException");
    E.printStackTrace();
    }

    catch(ArithmeticException AE)
    {
    System.out.println("ArithmeticException");
    E.printStackTrace();
    }

    }
    }
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Amersfoort, The Netherlands
    Posts
    10
    Rep Power
    0
    - What is the error you encounter?
    - What doesn't work

    Erwin
  8. #5
  9. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    IE.printStackTrace();

    and

    AE.printStackTrace();
  10. #6
  11. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    Vagrant, that's an unacceptable topic and an unacceptable post. Please read this: http://www.tuxedo.org/~esr/faqs/smart-questions.html before posting again.

IMN logo majestic logo threadwatch logo seochat tools logo