Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Division by zero exception

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    11
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Division by zero exception

    I am learning java. And have some doubts to be sorted out. I want to know that if a number is divided by 0 than it throw ArithematicException. And if i take any string from user as input and stored in int a; Which is checked exception here and which one is unchecked.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Division by zero exception

    It is probably best to write up some test code and see what happens. Do that and post your code with your question(s) if you have any

  3. #3
    Member Ganeprog's Avatar
    Join Date
    Jan 2014
    Location
    Chennai,India
    Posts
    80
    My Mood
    Love
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: Division by zero exception

    Hi,

    If you are checking exception at compile time that is called checked exception.(Ex: some syntax problem)
    If you are checking exception at run time that is called un-checked exception.(Ex: Arithmetic exception)

    Thanks,

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Division by zero exception

    Again, before responding, check the date of the first post in a thread and then the activity of the OP. You might even check that person's profile or stats to see when they last posted. A post that has lain dormant for more than 2 weeks is "dead." A user that hasn't returned for a month has lost interest in their last post and probably in the Forum or the language.

    Closing this thread to avoid further pointless churn.

Similar Threads

  1. [SOLVED] Division and lots of 0's?
    By sci4me in forum Java Theory & Questions
    Replies: 0
    Last Post: July 25th, 2013, 11:35 PM
  2. division
    By ericgomez in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 23rd, 2013, 10:15 AM
  3. Division by Zero
    By mael331 in forum Java Theory & Questions
    Replies: 16
    Last Post: December 6th, 2011, 06:13 PM
  4. division problem
    By vgenopoulos in forum Java Theory & Questions
    Replies: 1
    Last Post: July 30th, 2010, 01:51 PM
  5. [SOLVED] Java program to write a code to detect divisibility of any number by 11
    By Java'88 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: August 11th, 2009, 10:41 PM