• Kĩ thuật lập trình - Files and streamsKĩ thuật lập trình - Files and streams

    To open a file for reading objects, create a FileInputStream wrapped by an ObjectInputStream FileInputStream provides methods for reading byte-based input from a file ObjectInputStream uses FileInputStream to read objects from file ObjectInputStream method readObject reads in object, which is then downcast to proper type EOFException occurs if ...

    ppt82 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1191 | Lượt tải: 0

  • Kĩ thuật lập trình - Exception handlingKĩ thuật lập trình - Exception handling

    Assertions are conditions that should be true at a particular point in a method Help ensure a program’s validity by catching potential bugs Preconditions and Postconditions are two kinds of assertions Assertions can be stated as comments or assertions can be validated programmatically using the assert statement

    ppt90 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1136 | Lượt tải: 0

  • Kĩ thuật lập trình - Graphics and java 2d™Kĩ thuật lập trình - Graphics and java 2d™

    An ArrayIndexOutOfBoundsException is thrown if the number of points specified in the third argument to method drawPolygon or method fillPolygon is greater than the number of elements in the arrays of coordinates that specify the polygon to display.

    ppt74 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1103 | Lượt tải: 0

  • Kĩ thuật lập trình - Gui components: Part 1Kĩ thuật lập trình - Gui components: Part 1

    It is possible to set a Container’s layout to null, which indicates that no layout manager should be used. In a Container without a layout manager, the programmer must position and size the components in the given container and take care that, on resize events, all components are repositioned as necessary. A component’s resize events can be process...

    ppt174 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 977 | Lượt tải: 0

  • Kĩ thuật lập trình - Object - Oriented programming: PolymorphismKĩ thuật lập trình - Object - Oriented programming: Polymorphism

    Using a superclass reference, we can polymorphically invoke any method specified in the superclass declaration (and in class Object). Using an interface reference, we can polymorphically invoke any method specified in the interface declaration (and in class Object).

    ppt90 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1194 | Lượt tải: 0

  • Kĩ thuật lập trình - Object - Oriented programming: InheritanceKĩ thuật lập trình - Object - Oriented programming: Inheritance

    At the design stage in an object-oriented system, the designer often finds that certain classes are closely related. The designer should “factor out” common instance variables and methods and place them in a superclass. Then the designer should use inheritance to develop subclasses, specializing them with capabilities beyond those inherited from th...

    ppt89 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1507 | Lượt tải: 0

  • Kĩ thuật lập trình - Classes and objects: A deeper lookKĩ thuật lập trình - Classes and objects: A deeper look

    Not initializing a final instance variable in its declaration or in every constructor of the class yields a compilation error indicating that the variable might not have been initialized. The same error occurs if the class initializes the variable in some, but not all, of the class’s constructors.

    ppt118 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1396 | Lượt tải: 0

  • Kĩ thuật lập trình - ArraysKĩ thuật lập trình - Arrays

    Command-line arguments Pass arguments from the command line String args[] Appear after the class name in the java command java MyClass a b Number of arguments passed in from command line args.length First command-line argument args[ 0 ]

    ppt100 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1118 | Lượt tải: 0

  • Kĩ thuật lập trình - Methods: a deeper lookKĩ thuật lập trình - Methods: a deeper look

    Enumerations Programmer-declared types consisting of sets of constants enum keyword A type name (e.g. Status) Enumeration constants (e.g. WON, LOST and CONTINUE) cannot be compared against ints

    ppt88 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1119 | Lượt tải: 0

  • Kĩ thuật lập trình - Control statements: part 2Kĩ thuật lập trình - Control statements: part 2

    State Machine Diagrams Commonly called state diagram Model several states of an object Show under what circumstances the object changes state Focus on system behavior UML representation State Rounded rectangle Initial state Solid circle Transitions Arrows with stick arrowheads

    ppt95 trang | Chia sẻ: huyhoang44 | Ngày: 17/03/2020 | Lượt xem: 1160 | Lượt tải: 0