• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/20

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

20 Cards in this Set

  • Front
  • Back

It consists of three operands and is used to evaluate boolean expressions.


a. Ternary operator


b. Logical operator


c. Assignment operator


d. Cast operator

a. Ternary operator

What is the result of 7%2


a. 3


b. 2


c. 1


d. 4

c

what does two dimesional array do?


a. It creates two arrays at once.


b. It forms a tabular, two dimensional arrangement


c. None of the choice


d. It creates an array with only two elements

b. It forms a tabular, two dimensional arrangement

Consider the following codes:


int x=3;


System.out.println(x++);


What will be the EXACT output?


a. 3


b. 2


c. 4


d. 1

a. 3

An operator that divides left-hand operand by right-hand operand.


a. *


b. -


C. +


d. /

d. /

It divides left operand with the right operand and assign the result to left operand.


a. /=


b. -=


c. *-


d. +=

a. /=

shift operators decrease the value of the variable by a particular number by which it was decreased. T/F

f

The _______ loop facilitates evaluation of condition or expression at the end of the loop to ensure that the statements are executed at least once


a. for


b. while


c. Do while

c. Do while

It adds right operand to the left operand and assign the result to left operand.


a. -=


b. *-


c. +=


d. /=

c. +=

What does the code output?


int p=0;


while (p<3)


{


System.out.println("hi");


p++;


}


System.out.println("bye");


a. hi


hi


bye


b. hi


bye


c. hi


hi


hi


bye


d. hi


hi


Bye


hi

c. hi


hi


hi


bye

What is the output of the following code fragment:


int[] ar = {2, 4, 6, 8 };


ar[0] = 23;


ar[3] = ar[1];


System.out.println( ar[0] + " " + ar[3] );


a. 23 4


b. 23 2


c. 31


d. 2 8


a. 23 4

Increment operators increase the value of the variable by a particular number by which it is increased. T/F

t

The statements associated with this keyword is executed if the value of the switch variable does not match any of the case constants.


a. Default


b. else


c. Last option

a. Default

Assigns values from right side operands to left side operand.


a. ==


b. :


c. =


D. |

c. =

The while loop executes a given statement or block of statements repeatedly as long as the value of the expression is true. T/F

t

Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.


a. <


b. >>


c. <=


d. >=

d. >=

Consider the following codes:


int x=3;


System.out.println(--x);


What will be the EXACT output?


a. 1


b. 2


c. 4


d. 3


b. 2

Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.


a. <


b. <


c. >


d. >>

a. <


Mali ito

What will be the output of the following program?


public class Tango


{


public static void main(String[] args)


{


int[] print = new int[]{0, 1, 2, 3, 4, 5};


System.out.print("\"Prints = ");


System.out.print(print[0] + print[5] + print[2] + "\"");


}


}


a. Compilation error


b. “Prints = 7"


c. \”Prints = 7\”


d. “Prints = 052”


b. “Prints = 7"

What will be the output of the following program?


class ArrayOutput


{


public static void main(String s[])


{


int[][] input = {{3, 5, 6, 7}, {2, 4}, {1}, {2, 3, 4, 5}};


int result = 1;


for(int i = 0; i < input.length; i++)


{


for(int j = 0; j < input[i].length - 1; j++)


{


result *= input[i][j];


}


}


System.out.println("Result = " + result);


}


}


a. Throws ArrayIndexOutOfBoundsException


b. Result = 4320


c. Result = 50400


d. Result = 360

b. Result = 4320