NegativeArraySizeException


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: NegativeArraySizeException

  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Question NegativeArraySizeException

    Hi, I'm wondering if anyone can illustrate how I can throw the above exception using Try/Catch ?

    Thanks.

  2. #2
    Join Date
    May 2004
    Posts
    219
    You mean you want to catch NegativeArraySizeException?

  3. #3
    Join Date
    Feb 2004
    Posts
    541
    You can throw anything you like using the keyword throw....

    Code:
    try
    {
        //some code here
    }
    catch(SomeException e)
    {
        throw new AnythingYouLike();
    }

    If it is a checked exception (ie not a runtime exception), then your method has to declare that it may throw it using the keyword throws after the method declaration, ie
    Code:
    public void myMethod throws MyException

  4. #4
    Join Date
    Jul 2004
    Posts
    2

    Smile

    Guys, thank you all for your help - problem now solutioned.

  5. #5
    Join Date
    Feb 2004
    Posts
    808

    Re: NegativeArraySizeException

    Originally posted by javanovice
    Hi, I'm wondering if anyone can illustrate how I can throw the above exception using Try/Catch ?

    Thanks.
    heh, so decide.. do you want to throw, or do you want to catch? the two are rather.. er.. opposite things, you know
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center