¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Java - Lecture 2

dieollekrissi Object Oriented Programming Alemán 36 fichas

Java - Lecture 2

Fichas del conjunto (36)

  1. 1Which Java features are the most important ones related to OOP?-Abstraction
    -Encapsulation
    -Inheritance
    -Polymorphism
  2. 2Keywords reserved in Java syntaxabstract
    boolean
    break
    byte
    case
    catch
    char
    class
    const
    continue
    default
    do
    double
    else
    extends
    final
    finally
    float
    for
    goto
    if
    implements
    import
    instanceof
    int
    interface
    long
    native
    new
    package
    private
    protected
    public
    return
    short
    static
    strictfp
    super
    switch
    synchronized
    this
    throw
    throws
    transient
    try
    void
    volatile
    while
  3. 3What are comments?- descriptions that are adopted to a program to make a code easier to understand
    - compiler ignores comments & hence its only for documentation of the program
  4. 4Block Style commentsbegin with /* & terminate with */ that spans multiple lines
  5. 5Line Style commentsbegin with //and terminate at the end of the line
  6. 6Documentation Stylebegin with /** and terminate with */
  7. 7Variablesused for data that changes during program execution
    -> always have a name, type and scope
    -> names assigned by programmer; names -> identifiers
  8. 8Identifiersmust be unique within a scope of the Java program
  9. 9data typeindicates the kind of value a variable can store
  10. 10integerbyte, short, int, and long
  11. 11Floating pointfloat and double
  12. 12Characterchar
  13. 13Booleanvariable with a value of true or false
  14. 14byteDefault value: 0
    Range: -127 to +128
  15. 15shortDefault value: 0
    Range: -32768 to +32767
  16. 16intDefault value: 0
  17. 17longDefault value: 0L
  18. 18floatDefault value: 0.0f
  19. 19doubleDefault value: 0.0d
  20. 20charDefault value: '\u0000'
    Range: 0 to 65535
  21. 21String objectDefault value: null
  22. 22What is an Object?instance of a class created using a new operator. The operator returns a reference to a new instance of a class. This reference can be assigned to a reference variable of the class.
    THE PROCESS of creating objects from a class is called INSTANTIATION
  23. 23What is an interface?it is a contract in the form of collection of method & constant declarations.
    When a class implements an interface it promises to implement all of the methods declared in that interface.
  24. 24Instance Members-each object will have its own copies of the fields defined in its class : called instance variables (represent an object in its state)
    -The methods of an object define its behaviour called instance method.
  25. 25Static Members-static variable: is initialized when the class is loaded
    -static methods
    --> static members can be accessed either by using the class name or by using the object reference
  26. 26Assignment operators=
    it has the following syntax:
    =
    if the value already exists in the variable it is overwritten by the assignment operator
  27. 27Arithmetic operators- ; + ; * ; / ; % ; ++ ; --
    subtraction , addition , multiplication , division , modulo ( remainder) , increment ( add 1), decrement (subtract 1) and negotiation
  28. 28Relational operators-are used to compare 2 or more objects
    greater than ( > )
    less than ( < )
    greater than or equal ( >= )
    less than or equal ( <= )
    equal ( == )
    not equal ( != )
    --> evaluation results in a boolean value
    (lower that arithmetic operators but higher than assignemnt operators)
  29. 29Logical Operators ( in text form )AND ( & )
    conditional AND ( && )
    OR ( | )
    conditional OR ( | )
    exclusive OR ( ^ )
    NOT ( ! )
    each argument to a logical operator must be a boolean data type and the result is always a boolean data type
  30. 30Logical operatorsLogical operators
  31. 31Bitwise Operators ( text form )Java provides Bit wise operators to manipulate the contents of variables at the bit level. These variables must be of numeric data type
    (char, short, int, long)
    - there are seven bitwise operators in Java
    AND
    OR
    Exclusive OR
    Complement
    Left-shift
    Signed Right-Shift
    Unsigned Right-Shift
  32. 32Bitwise OperatorsBitwise Operators
  33. 33Compound Operatorsperform shortcuts in common programming operations (11 compound assignment operators in JAVA)
    Syntax: argument + 1operator = argument 2
    The above statement is the same as
    argument1 = argument 1 operator argument2
  34. 34Conditional operators-only ternary operator ( takes 3 arguments)
    -evaluates the first argument and if true evaluates the 2nd argument
    -if the first argument evaluates to false, then the 3rd argument is evaluated
    -conditional operator is the expression equivalent to the if-else statement
    - conditional expression can be nested and the conditional operator associates from right to left :
    (a?b?c?d:e:f:g) evaluates as
    (a?(b?(c?d:e):f):g)
  35. 35operators precedence ( in text form )-operators at the top of the table are applied before operators lower down in the table
    - operators with the same precedence are applied from left to right
  36. 36operators precedenceoperators precedence

Información

Descripción
Object Oriented Programming Fichas sobre Java - Lecture 2, creado por dieollekrissi el 23/06/2014.
Creado por
dieollekrissi
Visitas
39
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?