Skip to main content

Command Palette

Search for a command to run...

How to convert String to Integer in java

Published
•1 min read•View as Markdown
R

subscriber to our youtube channel url: https://www.youtube.com/@realNameHiddenN

for explanation watch the video

import java.util.*;
import java.lang.*;
class Demo{
    public static void main(String[] args){
        String s = "9999";
        int num1 = Integer.parseInt(s);
        System.out.println(num1);
        int num2 = Integer.valueOf(s);
        System.out.println(num2);
    }   
}

More from this blog

realNameHidden

72 posts

youtube channel : https://www.youtube.com/@realNameHiddenN