Answers for "how to ouput something in java"

7

how to input in java

import java.util.Scanner;
...
  Scanner console = new Scanner(System.in);
  int num = console.nextInt();
  console.nextLine() // to take in the enter after the nextInt() 
  String str = console.nextLine();
Posted by: Guest on January-05-2020
0

how to input in java

import java.util.*; //or java.util.scanner
Scanner doit = new Scanner(System.in);//Name the scanner
System.out.println("Username:");//It will specify username
String username = doit.next();//Use scanner and add .next for string .nextInt for int and follows
Posted by: Guest on June-07-2021

Code answers related to "how to ouput something in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language