Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 75d5941

Browse files
author
Ram swaroop
committed
divide by zero : added comments
1 parent c412b8e commit 75d5941

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/me/ramswaroop/practice/DivideByZero.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
public class DivideByZero {
1111
public static void main(String[] a) {
12-
System.out.print(5.0/0);
12+
System.out.println(5.0/0); // doesn't throw any exception
13+
System.out.println(5/0); // throws runtime exception (arithmetic exception)
1314
}
1415
}

0 commit comments

Comments
 (0)