Generate Number Format exception in java

Write a program to generate Number Format exception in java.

package Exception_demo;

import java.util.*;
public class exception_3 
    public static void main(String args[])
        Scanner s=new Scanner(;
        String s1;
        System.out.println("enter string");;
            int i=Integer.parseInt(s1);        

Leave a Reply

Your email address will not be published. Required fields are marked *