Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

OOP F2 (M3 M4)

QuestionAnswer
Consider the following codes: int x=4; System.out.println(x++); What will be the EXACT output? 4
What will be the output of the following program? int c = 0, e = 50; boolean b = (c == 1) && (++e < 100); System.out.println("e = " + e); boolean f = (++e < 100) && (c == 1); System.out.println("e = " + e); e = 50 e = 51
What is the output of the following code fragment? for ( int j = 10; j > 5; j-- ) { System.out.print( j + " " ); } System.out.println( ); 10 9 8 7 6
What will be the output of the following program? class ArrayOutput { public static void main(String s[]) { int i[] = {12, 15, 16, 17, 19}; for(int i = 0; i < 5; i++) { System.out.println(i[i]); } } } Compilation Error
Increment operators increase the value of the variable by a particular number by which it is increased true
What is the result of -7%2 -1
Consider the following codes: int x=2; System.out.println(--x); What will be the EXACT output? 1
An operator that decreases the value of operand by 1. --
What is the output of the following code fragment? for ( int j = 5; j > -5; j-- ) System.out.print( j + " " ); System.out.println( ); 5 4 3 2 1 0 -1 -2 -3 -4
The else statement performs a different set of statements if the expression is false. True
An operator that multiplies values on either side of the operator. *
Consider the following codes: int x=2; System.out.println(x--); What will be the EXACT output? 2
bitwise operator is an operator used to perform bitwise operations on bit patterns or binary numerals that involve the manipulation of individual bits true
shift operators decrease the value of the variable by a particular number by which it was decreased false
What must the initialization be so that the following fragment prints out the integers -3 -2 -1 ? for ( _______; j < 0; j++ ) System.out.print( j + " " ); System.out.println( ); int j = -3
What must the test be so that the following fragment prints out the integers 5 through and including 15? for ( int j = 5; ________ ; j++ ) { System.out.print( j + " " ); } System.out.println( ); j<16
What is the output of the following program fragment? for ( int j = 0; j < 5; j++ ) { System.out.print( j + " " ); } System.out.println( ); 0 1 2 3 4
boolean lampX = false, result; boolean lampY = true; result = lampY || lampX; System.out.println("Lamp switch-on " + result); result = lampY && lampX; System.out.println("Lamp switch-on " + result); Lamp switch-on true Lamp switch-on false
The goal of this operator is to decide, which value should be assigned to the variable. Ternary operator
Consider the following codes: int x=3; System.out.println(x--); What will be the EXACT output? 3
What is the result of 7|2 7
Consider the following codes: int x=4; System.out.println(7>>2); What will be the EXACT output? 1
When a piece of code runs unintentionally forever it is known as An infinite loop
hat will be the output of the following program? int x = 15; int y = x % 4; int z = y * 24; System.out.println(z / 2); 36
What is the output of the following code fragment: int[] zip = new int[5]; zip[0] = 7; zip[1] = 3; zip[2] = 4; zip[3] = 1; zip[4] = 9; int j = 3; System.out.println( zip[ j-1 ] ); 4
Checks if the values of two operands are equal or not, if yes then condition becomes true. ==
An operator that copies a bit to the result if it exists in both operands. & (bitwise AND)
What is the output of the following code fragment int count = 0; for ( ; count < 9; ++count ) System.out.print( count + " " ); System.out.println( ); 0 1 2 3 4 5 6 7 8
Consider the following codes: int x=4; System.out.println(--x); What will be the EXACT output? 3
What is the output of the following code fragment: int[] y = new int[5]; y[0] = 34; y[1] = 88; System.out.println( y[0] + " " + y[1] + " " + y[5] ); The program is defective and will not compile.
The label identifies any valid statement to which control must be transferred true
Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. >=
The do-while loop facilitates evaluation of condition or expression at the end of the loop to ensure that the statements are executed at least once true
Consider the following codes: int x=1; System.out.println(x++); What will be the EXACT output? 1
An operator that can be used to add String objects. +
What must the change be so that the following fragment prints out the even integers 0 2 4 6 8 10? for ( int j = 0; j <= 10; _______ ) System.out.print( j + " " ); System.out.println( ); j = j+2
What is the value of i after this loop runs? int i=0; do { System.out.println("hello"); i=i+1; }while (i<20); i = 20
What is the output of the following code fragment: int[] ar = {2, 4, 6, 8 }; System.out.println( ar[0] + " " + ar[1] ); 2 4
What will be the output of the following program? int c = 0, e = 50; boolean b = (c == 1) || (++e < 100); System.out.println("e = " + e); boolean f = (e++ < 100) || (c == 1); System.out.println("e = " + e); e = 51 e = 52
The ____ statement enables your program to selectively execute other statements, based on some criteria if
Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. <=
It multiplies right operand with the left operand and assign the result to left operand. *-
What will be the output of the following program? int num = 69; int days = num % 30; int month = num / 30; System.out.println(month + " Month and " + days + " days"); 2 Month and 9 days
What is the output of the following code fragment: int[] zip = new int[5]; zip[0] = 7; zip[1] = 3; zip[2] = 4; zip[3] = 1; zip[4] = 9; System.out.println( zip[ 2 + 1 ] ); 1
Supposed: double x = 13.1614; int y = (int)x; what is the value of y? 13
The _______ loop facilitates evaluation of condition or expression at the end of the loop to ensure that the statements are executed at least once do while
What will be the output of the following program? boolean a = true; boolean b = true; boolean c = a & b; boolean d = a ^ b; boolean e = a || !b || c || !d; System.out.println("e = " + e); e = true
What will be the output of the following program? int i, j, k, l = 0; k = l++; j = ++k; i = j++; System.out.println(i); 1
bitwise operator returns the result of shifting the bits of the left operand by the number of positions specified by the right operand. false
It consists of three operands and is used to evaluate Boolean expressions Ternary operator
What is an array? A sequence of values.
Consider the following codes: int x=4; System.out.println(x++); What will be the EXACT output? 4
A condition is a statement that is either True or False
What is the output of the following code fragment: int[] z = new int[9]; z[0] = 7; z[1] = 3; z[2] = 4; System.out.println( z[0] + z[1] + " " + z[5] ); 10 0
What is the operator in which the left operands value is moved left by the number of bits specified by the right operand. <
decrement operators decrease the value of the variable by a particular number by which it was decreased true
The continue statement causes the program flow to exit prematurely from the body of the loop statement. false
What does the code output? int p=0; while (p<3) { System.out.println("hi"); p++; } System.out.println("bye"); hi hi hi bye
How do you access an array element? By the name of the array followed by the index value in brackets.
An operator that is used in converting one type into another type or an object into another Cast
Assigns values from right side operands to left side operand. =
The statements associated with else keyword is executed if the value of the switch variable does not match any of the case constants. true
Consider the following codes: int x=3; System.out.println(++x); What will be the EXACT output? 4
Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. !=
The while loop executes a given statement or block of statements repeatedly as long as the value of the expression is true. true
Cast operator is used in converting one type into another type or an object into another true
Created by: pioneerxxXXxx
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards