Computer Applications
Answer the following:
(a) Scanner class method to accept a character.
(b) Jump statement which stops the execution of a construct.
Input in Java
3 Likes
Answer
(a) The Scanner class method to accept a character is <Scanner object>.next().charAt(0).
(b) The jump statement which stops the execution of a construct is break.
Answered By
2 Likes
Related Questions
Give the output of the following program segment:
for(r=1;r<=3;r++) { for(c=1;c<r;c++) { System.out.println(r); } }Give the output of the following program segment:
void encode() { String s= "DICe"; char ch; for(i=0;i<4;i++) { ch=s.charAt(i); if("AEIOUaeiou".indexOf(ch)>=0) System.out.println("@"); else System.out.println(ch); }Name the following:
(a) What is the main condition to perform binary search on an array?
(b) A sort method in which consecutive elements are NOT compared.
How many times the given loop is executed? Give the output of the same.
for(k=10;k<=20;k+=4) { System.out.println(k); if(k%3==0) continue; }