VNUHCM
Bài trước Bài kế tiếp
  • Nội dung học
  • Trợ giúp
    Bạn có thắc mắc khi đang học?
    Hướng dẫn cách học Những câu hỏi thường gặp Email cho giáo vụ
    • Tiếng Việt
    • English
    • Thông tin Thành viên
    • Khoá học đăng ký
    • Đăng xuất
  • Cohota
  • HƯỚNG DẪN HỌC TẬP

  • Xem chi tiết >>
    Bạn đã hoàn thành 0% khoá học
  • HƯỚNG DẪN SINH VIÊN ĐĂNG NHẬP HỆ THỐNG
    • Hướng dẫn đăng nhập
    • Hướng dẫn vào khóa học
  • Introduction
    • Welcome
  • Unit 1: Values
    • Introduction - Unit 1: Values
    • Get Started With Values
    • Play with Values
    • Playground Basics
    • Naming and Identifiers
    • Simulation
    • Strings
    • Constants and Variables
    • Word Games
    • Build a PhotoFrame App
    • Design for People
  • Episode 1: The TV Club
    • Introduction - Episode 1: The TV Club
    • Searching for Content
    • Sharing Personal Information
    • Ordering Online
    • Reflection: Episode 1
  • Unit 2: Algorithms
    • Introduction - Unit 2: Algorithms
    • Get Started with Algorithms
    • Play with Programs
    • Functions
    • Types
    • Parameters and Results
    • Making Decisions
    • BoogieBot
    • Data Visualization
    • Build a QuestionBot App
    • Design an Experience
  • Episode 2: The Viewing Party
    • Introduction - Episode 2: The Viewing Party
    • Accessing the Show
    • Streaming on the Network
    • Reflection: Episode 2
  • Unit 3: Organizing Data
    • Introduction - Unit 3: Organizing Data
    • Get Started with Organizing Data
    • Play with Complex Data
    • Instances, Methods, and Properties
    • Arrays and Loops
    • Structures
    • Enums and Switch
    • Testing Code
    • Processing Data
    • Pixel Art
    • Password Security
    • Visualization Revisited
    • Build a BouncyBall App
    • Design a Prototype
  • Episode 3: Sharing Photos
    • Introduction - Episode 3: Sharing Photos
    • Capturing Images
    • Posting on Social Media
    • Reflection: Episode 3
  • Unit 4: Building Apps
    • Introduction - Unit 4: Building Apps
    • Get Started with App Development
    • Play with App Components
    • Color Picker
    • ChatBot
    • Rock, Paper, Scissors
    • MemeMaker
    • Build an ElementQuiz App
    • Design for Impact
  • Appendix
    • Episode Technical Concepts
    • Glossary
Tổng quan điểm khóa học
Đánh giá

Tiến độ
Tên tiêu chí Trọng số (%) Điểm Tiến độ (%)
Unit 3: Organizing Data

Instances, Methods, and Properties

Unit 3: Organizing Data|Play

What you'll do

  • Set up a dance-off between two robots.

What you'll learn

  • How to create values without using literals.
  • What extra information and abilities the String type has.
  • How to find out more about any type.

Key vocabulary

  • Initializer
  • Instance
  • Method
  • Property

Introduction

Types allow you to understand what each value in your code represents, and type safety makes sure you use values of the right type in the right place. But types describe additional things too. Values of a certain type can give specific information or do specific things. In this lesson you’ll learn about some of the extra features of the types you’ve already used, and how to find out about new types.

Go Build

Open the Instances, Methods, and Properties.playground file in your course resources and follow the instructions.

Screenshot of the InstancesMethodsProperties playground

Reflection Questions

Think about an appliance—such as a TV, refrigerator, or washing machine—in or near your home.

What are some functions that are associated with it?

Do any functions take input from the user about how it should do its job?

Summary

Instances are a powerful way to hold values, because their separate identities let you track and manipulate each piece of information independently.

Depending on their type, different kinds of instances can store different information and perform different tasks. Since it's tough to remember all ​the capabilities of every type, API authors usually publish documentation or guides about the methods and properties contained ​in each type. Learning to read and make sense of this documentation is ​one of the most important skills a programmer can acquire.

In the next lesson, you'll learn how to use loops to do the same work with many items without writing a ton of repetitive code.

Báo lỗi