Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TestClass {
- String inputString = "Bla";
- int inputInteger = 0;
- public void startProgram(){
- System.out.println("Gib eine Zahl ein:");
- Scanner sc = new Scanner(System.in);
- inputString = sc.next();
- inputInteger = Integer.parseInt(inputString);
- }
- public static void main(String[] args){
- TestClass testClass = new TestClass();
- testClass.startProgram();
- }
- }
Add Comment
Please, Sign In to add comment