filmov
tv
Read array input of characters in Java | Arrays | Scanner | Part 1 of 2 | Java coding for beginners

Показать описание
Read array input of characters in Java | Arrays | Scanner | Java coding for beginners
There are four possible input cases to read an array of characters.
1:16 input case1:
Input consists of two lines.
First line of input is an integer n
Second line of input contains n whitespace separated integers
ex 1:
5
p ? k r t
output:
[ 'p' '?' 'k' 'r' 't' ]
ex 2:
4
b a l i
output:
[ 'b' 'a' 'l' 'i' ]
10:17 input case2:
Input is one single line of input consisting of whitespace separated characters
ex 1:
a b c 0 1 2 3
output:
[ 'a' 'b' 'c' '0' '1' '2' '3' ]
ex 2:
0 3 ? p t
output:
[ '0' '3' '?' 'p' 't' ]
Referenced videos:
Find more about my CodeWithBK Hindi Channel here: @CodeWithBKHindi
Follow me:
Java concepts for ISC Class 12 Computer Science students
Java concepts for beginner students in Java Programming
Java practice program in loops and input for beginners.
ISC Class 12 practice problem for beginners in numbers.
#javaforbeginners #javaprogramming #iscclass12 #javaclass #javacoding #class12computerscience #class12th #class12boardspreparation #computerscienceclass12
There are four possible input cases to read an array of characters.
1:16 input case1:
Input consists of two lines.
First line of input is an integer n
Second line of input contains n whitespace separated integers
ex 1:
5
p ? k r t
output:
[ 'p' '?' 'k' 'r' 't' ]
ex 2:
4
b a l i
output:
[ 'b' 'a' 'l' 'i' ]
10:17 input case2:
Input is one single line of input consisting of whitespace separated characters
ex 1:
a b c 0 1 2 3
output:
[ 'a' 'b' 'c' '0' '1' '2' '3' ]
ex 2:
0 3 ? p t
output:
[ '0' '3' '?' 'p' 't' ]
Referenced videos:
Find more about my CodeWithBK Hindi Channel here: @CodeWithBKHindi
Follow me:
Java concepts for ISC Class 12 Computer Science students
Java concepts for beginner students in Java Programming
Java practice program in loops and input for beginners.
ISC Class 12 practice problem for beginners in numbers.
#javaforbeginners #javaprogramming #iscclass12 #javaclass #javacoding #class12computerscience #class12th #class12boardspreparation #computerscienceclass12