by Dinesh Thakur Category: array

Integer.parseInt() method is used for converting the data fed in form of strings into integer form.

import java.io.*;
class IntegerParseInt
{
    public static void main(String args[])
    throws IOException
    {
        BufferedReader BF= new BufferedReader(new InputStreamReader (System.in));
        int Number[]=new int[5];
        int i;
        String m;
        System.out.println("Enter 5 Numbers :");
        for(i=0;i<=4;i++)
        {
            m=BF.readLine();
            Number[i]=Integer.parseInt(m);
        }
        System.out.println("Your Entered 5 Numbers are :");
        for(i=0;i<=4;i++)
        {
            System.out.println(Number[i]);
        }
    }
}

Integer.parseInt(string) in Java



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles