Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Java: If, Else, While, litle program
import java.util.Scanner; class Rextester { public static void main(String[] args) { int start = 0; System.out.println("Enter an Integer: "); Scanner inputFromUser = new Scanner(System.in); int finish; if (inputFromUser.hasNextInt()){ finish = inputFromUser.nextInt(); System.out.println("Enter an String: "); }else{ finish = 1; System.out.println("Play by the rules,Enter an String: "); } Scanner inputWords = new Scanner(System.in); String words = inputWords.nextLine(); while(start<finish){ System.out.println(words); start += 1; } } }
run
|
edit
|
history
|
help
0
Current date and time in java
JAVA # Dizi ile Fibonaççi
Max palindrome string
LambdaExpression
moneda
Sqrt
RevArray
test1
LRU cache - Simple solution (costly)
Sum of EVEN and ODD nubmers (11 grade)