Lecture An introduction to object-oriented programming with Java: Chapter 10 - C. Thomas Wu

Chapter 10 introduce to Arrays and collections. After you have read and studied this chapter, you should be able to: Manipulate a collection of data values, using an array; declare and use an array of primitive data types in writing a program; declare and use an array of objects in writing a program; define a method that accepts an array as its parameter and a method that returns an array; describe how a two-dimensional array is implemented as an array of arrays; manipulate a collection of objects, using lists and maps. | ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 - Chapter 10 Arrays and Collections Animated Version Introduction to OOP with Java 4th Ed, C. Thomas Wu © The McGraw-Hill Companies, Inc. Objectives After you have read and studied this chapter, you should be able to Manipulate a collection of data values, using an array. Declare and use an array of primitive data types in writing a program. Declare and use an array of objects in writing a program Define a method that accepts an array as its parameter and a method that returns an array Describe how a two-dimensional array is implemented as an array of arrays Manipulate a collection of objects, using lists and maps Intro to OOP with Java, C. Thomas Wu ©The McGraw-Hill Companies, Inc. We will cover the basic array processing in this lesson, manipulating arrays of primitive data types and objects. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 - Array Basics An array is a collection of data values. If your program needs to deal with 100 integers, 500 Account objects, 365 real numbers, etc., you will use an array. In Java, an array is an indexed collection of data values of the same type. Intro to OOP with Java, C. Thomas Wu ©The McGraw-Hill Companies, Inc. Suppose you need to handle up to 300 Student objects in a program for maintaining a high school alumni list, would you use 300 variables? Suppose you need to process daily temperatures for a 12-month period in a science project, would you use 365 variables? You can, but would you? To manipulate a collection of data, we can use arrays. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 - Arrays of Primitive Data Types Array Declaration [ ] //variation 1 [ ] //variation 2 Array Creation = new [ ] Example double[ ] rainfall; rainfall = new . | ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 - Chapter 10 Arrays and Collections Animated Version Introduction to OOP with Java 4th Ed, C. Thomas Wu © The McGraw-Hill Companies, Inc. Objectives After you have read and studied this chapter, you should be able to Manipulate a collection of data values, using an array. Declare and use an array of primitive data types in writing a program. Declare and use an array of objects in writing a program Define a method that accepts an array as its parameter and a method that returns an array Describe how a two-dimensional array is implemented as an array of arrays Manipulate a collection of objects, using lists and maps Intro to OOP with Java, C. Thomas Wu ©The McGraw-Hill Companies, Inc. We will cover the basic array processing in this lesson, manipulating arrays of primitive data types and objects. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
187    24    1    24-11-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.