• Kĩ thuật lập trình - Chương 21: Multimedia: applets and applicationsKĩ thuật lập trình - Chương 21: Multimedia: applets and applications

    Classes Image and ImageIcon – used to load and display images Displaying images Graphics method drawImage – used to draw image referenced by Image object (can be scaled) ImageIcon method paintIcon can be used to draw image referenced by ImageIcon object Loading images Applet method getImage loads an Image into an applet Applet method getDocum...

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

  • Kĩ thuật lập trình - Chương 19: CollectionsKĩ thuật lập trình - Chương 19: Collections

    Because Stack extends Vector, all public Vector methods can be called on Stack objects, even if the methods do not represent conventional stack operations. For example, Vector method add can be used to insert an element anywhere in a stack—an operation that could “corrupt” the stack. When manipulating a Stack, only methods push and pop should be us...

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

  • Kĩ thuật lập trình - Data structuresKĩ thuật lập trình - Data structures

    Queue class that contains a reference to a List Method enqueue calls List method insertAtBack Method dequeue calls List method removeFromFront Method isEmpty calls List method isEmpty Method print calls List method print

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

  • Kĩ thuật lập trình - Chương 16: Searching and sortingKĩ thuật lập trình - Chương 16: Searching and sorting

    Linear search Searches each element sequentially If search key is not present Tests each element When algorithm reaches end of array, informs user search key is not present If search key is present Test each element until it finds a match

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

  • Kĩ thuật lập trình - Chương 15: RecursionKĩ thuật lập trình - Chương 15: Recursion

    Method call stack used to keep track of method calls and local variables within a method call Just as with nonrecursive programming, recursive method calls are placed at the top of the method call stack As recursive method calls return, their activation records are popped off the stack and the previous recursive calls continue executing Current ...

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

  • 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: 644 | 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: 658 | 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: 598 | 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: 524 | 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: 654 | Lượt tải: 0