+ 7
How to print a statement before taking inputs in java (solo learn )?????
so that the user can know what to input..
9 Answers
+ 6
It is impossible. Users can know what to input by reading conments in the code
+ 6
but still in many other codes I saw that a pop up box appears with instructions before the input is given
+ 6
https://code.sololearn.com/c7S7lbwCxw3c/?ref=app.
this did not work @innocent Emmanuel.
+ 6
Yes,I know how to do that in my computer but I wanted to know if it could be done in solo learn
+ 3
It can also help to provide a sample and even: a default value.
+ 1
it is possible especially when we are making a calculator by asking the user to input numbers and operators
+ 1
just d normal out.println would do.... check dis out
import java.util.Scanner;
class myClass{
public static void main(String args[]){
System.out.println("Hello, Programming is fun");
Scanner kb = new Scanner(System.in);
System.out.print("What's your name?");
String name = kb.next();
System.out.println("You are " + name );
}
}
+ 1
Neelarghya kundu it printed b4 prompting me for input when I tried it with my laptop....