How to convert String to Integer in java

Total
0
Shares

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);
    }   
}


Enter fullscreen mode

Exit fullscreen mode

Total
0
Shares
Valentsea

ChatGPT Breaks into the Physical World: Introducing Shifu Plugin for ChatGPT

How I utilized the power of ChatGPT and its plugin capabilities to connect AI with IoT devices. As…

You May Also Like