filmov
tv
java user input | java output | java output formatting
Показать описание
Follow me on Instagram
00:10 using scanner class
05:08 string input
07:12 next() and nextLine()
10:04 printing output
12:07 print formatted output
Create object of scanner class and by using the object we can access methods of scanner class.
for integer input use method nextInt()
for double input use method nextDouble()
for long input use method nextLong()
similarly for different input use corresponding next method
for string input we can use next() and nextLine() method
next() will read only one token
nextLine() will read entire line
for output we can use
print() - which will print whatever is there in the bracket
println() - will print things inside bracket and cursor moves to next line
printf() - will give formatted output
% [flags] [width] [.precision] conversion-character
eg: %-10.2s
flag can be +-0,
width will print the total length
precision - up to how many letters or digits we need
conversion character - s for string, d for digit , t for date
java input output tutorial
java user input
how to give user input in java
java output
java output formatting
how to get formatted output in java
00:10 using scanner class
05:08 string input
07:12 next() and nextLine()
10:04 printing output
12:07 print formatted output
Create object of scanner class and by using the object we can access methods of scanner class.
for integer input use method nextInt()
for double input use method nextDouble()
for long input use method nextLong()
similarly for different input use corresponding next method
for string input we can use next() and nextLine() method
next() will read only one token
nextLine() will read entire line
for output we can use
print() - which will print whatever is there in the bracket
println() - will print things inside bracket and cursor moves to next line
printf() - will give formatted output
% [flags] [width] [.precision] conversion-character
eg: %-10.2s
flag can be +-0,
width will print the total length
precision - up to how many letters or digits we need
conversion character - s for string, d for digit , t for date
java input output tutorial
java user input
how to give user input in java
java output
java output formatting
how to get formatted output in java