0

what is the meaning of this code line: System.out.println("Special Customer <Yy/Nn>:?");

Its a code line from one of my textbook program. I don't know what does it mean.

28th Sep 2016, 4:36 PM
Bharat Gunhalkar
Bharat Gunhalkar - avatar
7 Respostas
+ 3
this statement ask the user if he is special customer enter Y or y .and if he is not to enter N or n ...easy..
13th Oct 2016, 2:20 PM
Mohammed Al-Hababi
Mohammed Al-Hababi - avatar
+ 1
System.out.print (); is a statement the prints output. inside the () you pass the arguments you want to be output ed to a screen. you had the string literal "Special Customer <Yy/Nn>:?" passed into the argument. there for output to screen is: Special Customer <Yy/Nn>:?
29th Sep 2016, 1:21 AM
Machete X7
Machete X7 - avatar
+ 1
its just a way to explain to the user what answer is expected.. With --- System.out.println() --- you show a message and the idea is that the user write -- y or Y -- if is talking about a special customer on -- n or N -- in other case... for example in a supermarket or some place like that... sorry for the english, gretings from Argentine
15th Oct 2016, 11:18 PM
Tomas Damianovich Reddy
Tomas Damianovich Reddy - avatar
0
The term in your text book System.out.println("Special Customer <Yy/Nn>:?"); Actually means that the user has to input either a Capital letter or a Small letter of Y or N. Any of the input runs through a switch or if/else statement to determine the actual context or reply it is going to display next. if non of d required character "char type" is keyed into d program, it prints a default statement or else statment.
20th Oct 2016, 11:12 PM
Franky BrainBox
Franky BrainBox - avatar
- 1
System is a class and println is a method of another class named input stream, and .out is an instance of class input stream stored as a data member of class System.
7th Oct 2016, 11:39 AM
Harshvardhan Trivedi
Harshvardhan Trivedi - avatar
- 2
It prints out: Special Customer <Yy/Nn>:? Anything within the double quotes will be printed to the console. System.out.println("Hello"); //This will print 'Hello' to the console. Go to an IDE and test it out for yourself.
28th Sep 2016, 6:39 PM
Mythos
- 2
^^ System.out.println(""); is a method created in Java that prints whatever is in the quotes, if you want to print a value thats stored in a variable: int x = 15; System.out.println("X is: " + x);
28th Sep 2016, 7:57 PM
Chris