Java_Week_1.txt

Card Set Information

Author:
andrewdb3
ID:
265633
Filename:
Java_Week_1.txt
Updated:
2014-03-09 23:52:22
Tags:
java
Folders:

Description:
java 1
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user andrewdb3 on FreezingBlue Flashcards. What would you like to do?


  1. What is the use of Java Basic Operators?
    To manipulate variables.
  2. What are the arithmetic operators?
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Modulus %
    • Increment ++
    • Decrement- -
  3. What is the function of the addition AO?
    Adds values on either side of the operator.
  4. What is the function of the subtraction AO?
    Subtracts right-hand operand from the left-hand operand.
  5. What is an operator?
    Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result.
  6. What is an operand?
    A value involved in an operation.
  7. What is an operation?
    An action performed on one or more values either to modify the value held by one or both of the values, or to produce a new value by combining existing values.
  8. What is the function of multiplication?
    Multiplies values on either side of the operator.
  9. What is the function of division?
    Divides left hand operand by right hand operand.
  10. What is the function of modulus?
    Divides left hand operand by right hand operand and returns remainder.
  11. What is the function of increment?
    Increases the value of operand by 1
  12. What is the function of decrement?
    Decreases the value of operand by 1
  13. How many AOs are there?
    7 operators
  14. What are AOs used for?
    To manipulate variables
  15. How many Relational Operators are there?
    6 operators
  16. What is the function of the Assignment RO?
    Checks if the values of two operands are equal or not, if yes then condition becomes true.
  17. What is the function of the Not Equal To RO?
    Checks if the values of two operands are equal or not, if values are not equal then condition becomes true.
  18. What is the function of the Greater-Than RO?
    Checks if the value of left operand is greater than the value of right operand,if yes then condition becomes true.
  19. What is the function of the Less-Than RO?
    Checks if the value of le t operand is less than the value of right operand, if yes then condition becomes true.
  20. What is the function of the Greater-Than-Or_Equal_To RO?
    Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.
  21. What is the function of the RO?
  22. What is the function of the Less-Than-Or-Equal-To RO?
    Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.
  23. What is the function of a BO?
    Bitwise operator works on bits and performs bit-by-bit operation.
  24. What integer-types are BOs used with?
    • Long
    • Int
    • Short
    • Char
    • Byte
  25. What is the use of a BO?
    Research online
  26. How many Bitwise Operators are there?
    7 Operators
  27. What are the BOs?
    • Binary AND  (&)
    • Binary OR  (|)
    • Binary XOR    ()
    • Binary One's Complement  (~)
    • Binary Left Shift  (<<)
    • Binary Right Shift  (>>)
    • Shift Right Zero Fill (>>>)
  28. What is the Function of the BOs?
    Research later
  29. What are the Logical Operators?
    • Logical AND (&&)
    • Logical OR  (||)
    • Logical NOT  (!)
  30. What is the function of the Logical AND LO?
    If both the operands are non-zero, then the condition becomes true.

    Example : (A && B)is false.
  31. What is the function of the Logical OR LO?
    If any of the two operands are non-zero, then the condition becomes true.

    Example : (A || B) is true.
  32. What is the function of the Logical NOT LO?
    Used to reverse the logical state of its operand. If a condition is true then Logical NOT operator will make false.

    Example : !(A && B)is true.
  33. How many Assignment Operators are there?
    11 AOs
  34. What are the AOs?
    • Simple  (=)
    • Add AND  (+=)
    • Subtract AND (-=)
    • Multiply AND (*=)
    • Divide AND (/=)
    • Modulus AND  (%=)
    • Left-shift AND (<<=)
    • Right-shift AND  (>>=)
    • Bitwise AND (&=)
    • Bitwise exclusive OR  (∧=)
    • Bitwise inclusive OR  (|=)
  35. What is the Function of the Simple AO?
    Assigns values from right side operands to left side operand.

    Example : C = A + B will assignvalue of A + B into C
  36. What is the function of the Add AND AO?
    It adds right operand to the left operand and assign the result to left operand.

    Examples : C += A is equivalent toC = C + A
  37. What is the function of the Subtract AND AO?
    It subtracts right operand from the left operand and assign the result to left operand.

    Example : C -= A is equivalent toC = C - A
  38. What is the function of the Multiply AND AO?
    It multiplies right operand with the left operand and assign the result to left operand.

    Example : C *= A is equivalent toC = C * A
  39. What is the function of the Divide AND AO?
    It divides left operand with the right operand and assign the result to left operand.

    Example : C /= A is equivalent toC = C / A
  40. What is the function of the Modulus AND AO?
    It takes modulus using two operands and assign the result to left operand.

    Example : C %= A is equivalentto C = C % A
  41. What is the function of the Left-shift AND AO?
    Example : C <<= 2 is same as C= C << 2
  42. What is the function of the Right-shift AND AO?
    Example : C >>= 2 is same as C= C >> 2
  43. What is the function of the Bitwise AND AO?
    Example : C &= 2 is same as C =C & 2
  44. What is the function of the Bitwise-exclusive OR AO?
    Example : C ^= 2 is same as C =C ^ 2
  45. What is the function of the Bit-wise inclusive OR AO?
    Example : C |= 2 is same as C =C | 2
  46. How many Misc Operators are there?
    2 Operators
  47. What are the Misc Operators?
    • Conditional/Ternary Operator
    • InstanceOf Operator
  48. What is the structure of Conditional Operator?
    • This operator consists of three operands.
    • The operator is written as:

    variable x = (expression) ? value if true : value if false
  49. What is the function of the Conditional Operator?
    • It is used to evaluate Boolean expressions.
    • The goal of the operator is to decide which value should be assigned to the variable.
  50. An Example of the Conditional/Ternary Operator.
    • public class Test {
    • public static void main(String args[]){
    • int a , b;
    • a = 10;
    • b = (a == 1) ? 20: 30;System.out.println( "Value of b is : " + b );b = (a == 10) ? 20:30;
    • System.out.println( "Value of b is : " + b );
    •   }
    • }
    • This would produce the following result:

    • Value of b is : 30
    • Value of b is : 20
  51. What is the use of the instanceOf Operator?
    Used only for object reference variables.
  52. What is the function of the insatanceOf Operator?
    The operator checks whether the object is of a particular type(class type or interface type).
  53. What is the Structure of instanceOf Operator?
    ( Object reference variable ) instanceOf (class/interface type)
  54. Example1 of instanceOf Operator.
    If the object referred by the variable on the left side of the operator passes the IS-A check for the class/interface type on the right side, then the result will be true.

    Following is the example:

    • String name = = 'James';
    • boolean result = name instanceOf String;
    • // This will return true since name is type of String
  55. Example2 of instanceOf Operator.
    • This operator will still return true if the object being compared is the assignment compatible with the type on the right.
    • Following is one more example:

    • class Vehicle {}
    • public class Car extends Vehicle {
    •   public static void main(String args[]){
    •     Vehicle a = new Car();
    •     boolean result = a instanceof Car;
    •     System.out.println( result);
    •    }
    • }

    This would produce the f ollowing result:true
  56. How many Categories are there for Java Operator Precedence?
    15 Categories
  57. What are the categories of Java OP?
    PUMAS-REBBBLL-CAC

    • Postfix
    • Unary
    • Multiplicative
    • Additive
    • Shift
    • Relational
    • Equality
    • Bitwise AND
    • Bitwise XOR
    • Bitwise OR
    • Logical AND
    • Logical OR
    • Conditional
    • Assignment
    • Comma
  58. What are the Postfix Operators?
    () [] .(dot operator) 

    Left to right association
  59. What are the Unary Operators?
    ++ - - ! ~ (Right to left)
  60. What are the Multiplicative Operators?
    * / % (Left to right)
  61. What are the Additive Operators?
    + - (Left to right)
  62. What are the Shift Operators?
    >> >>> <<  (Left to right)
  63. What are the Rational Operators?
    > >= < <=  (Left to right)
  64. What are the Equality Operators?
    == !=  (Left to right)
  65. What is the Bitwise AND Operator?
    &
  66. What is the Bitwise XOR Operator?
  67. What is the Bitwise OR Operator?
    |
  68. What is the Logical AND Operator?
    &&
  69. What is the Logical OR Operator?
    ||
  70. What is the Conditional Operator?
    ?:
  71. What is the Assignment Operators?
    = += -= *= /= %= >>= <<= &= ^= |=

    (Right to left)
  72. What is the Comma Operator?
    ,

What would you like to do?

Home > Flashcards > Print Preview