Programming in Kotlin: Functions & Custom Types [SUBSCRIBER]

栏目: IT技术 · 发布时间: 4年前

Lambdas & Higher-Order Functions

Introduction

2:11 Free

Welcome to Programming in Kotlin: Functions and Custom Types! In this episode, find out what this course has in store for you.

Review some fundamentals about how functions and lambdas work, as well as their various syntax options.

Find out about how lambdas capture data and how they relate to the concept of higher-order functions.

Find out how writing lambdas can help you handle collections with two common alternatives to for loops: forEach and map!

Practice what you have learned about using lambdas and collections with this series of hands-on coding challenges.

Conclusion

5:55

Review what you've learned so far, and use six higher-order functions in a row in this fast-paced Part 1 finale!

Properties & Methods

In this part of the course, you'll study some features shared by named types in Kotlin: properties and methods!

In this episode, learn about a different kind of property that is recomputed every time it is accessed.

Companion objects are Kotlin's answer to static members. In this episode, find out what they can do for your custom types.

Practice everything you have learned about properties with custom accessors, and using companion objects.

Learn how to use delegated properties to observe property changes, delay the initialization of a property, and more!

Practice using what you've learned about different kinds of delegated properties in this series of hands-on challenges.

Methods

4:29

Take another look at methods in Kotlin. Learn when to reach for a method, or turn to property accessors.

Kotlin uses extension properties and methods to let you augment a type without changing the class definition.

Practice using everything you have learned about methods and extension properties and methods with hands-on challenges.

Conclusion

1:07

Review what you learned about properties and methods in this part of the course, and find out what's up next.

Class Inheritance & Interfaces

In this part of the course, learn how to use subclassing and interface adoption to let types inherit functionality.

Learn about an important and powerful feature of classes that lets one class inherit functionality from another class.

Overriding

5:17

When working with a class hierarchy, subclasses can have their own implementations of a parent's properties and methods.

Depending on the context, a subclass can be treated as its own type, or, as one of its superclasses.

Learn how to use primary and secondary constructors, and how subclassing affects class initialization.

Practice using all of the things you've learned about classes so far in this open-ended, hands-on challenge!

Interfaces

11:49

Learn how to make your types conform to interfaces in Kotlin, which you can think of as a to-do list for your types.

Practice using interfaces instead of class inheritance in the final challenge of this part of the course.

In this episode, learn five things to consider when you're trying to decide between subclassing and using an interface.

Conclusion

0:51

Review the key points you've learned about class inheritance and interfaces, and check out what's next.

Objects, Enum Classes, & Sealed Classes

Ready to learn about some specialized types in Kotlin: Objects, Enum Classes, and Sealed Classes? Let's dive in!

Objects

5:11

Kotlin introduces a new keyword that is unavailable in the other languages to which it is often compared.

Learn how to use Enum Classes to represent a specific set of related, discrete values like days of the week!

One of the most powerful features of Enum Classes in Kotlin is how they combine with the when expression.

Practice everything you've learned about Enum Classes and when expressions in this hands-on challenge.

A Sealed Class is a special type of class that combine aspects of Enum Classes, class inheritance, and interfaces.

Challenge time! Practice using Sets to store unique pieces of data by solving this challenge.

Conclusion

0:48

Congratulations on finishing the course - you've learned a ton of new Kotlin concepts! In this episode, find out where to go next to continue your journey.

Who is this for?

This course is part of our Android and Kotlin for Beginners learning path. You're ready for this course if you're working through that learning path in order, or you're someone who has some experience programming in Kotlin.

To start, you'll review some function and lambda fundamentals. You'll also practice writing lambdas and using them to manipulate collections.

Then, you'll move on to build your skills in writing custom types: classes, interfaces, enum classes, and more. You'll learn about features they share, and some of the functionality that makes each unique.

Throughout the course, you'll practice everything you learn with hands-on challenges. Ready? Let's get started!

This course isn’t suited for advanced developers. If that’s you, check out our intermediate or advanced video courses for more ways to level-up your developer skills!

Covered concepts

  • Lambdas
  • Higher-Order Functions
  • Custom Accessors
  • Delegated Properties
  • Methods
  • Companion Object Properties & Methods
  • Extension Properties & Methods
  • Class Inheritance
  • Polymorphism
  • Constructors
  • Interfaces
  • Objects
  • Enum Classes
  • When Expressions
  • Sealed Classes

以上所述就是小编给大家介绍的《Programming in Kotlin: Functions & Custom Types [SUBSCRIBER]》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

别具光芒

别具光芒

李烨 / 人民邮电出版社 / 2006-11 / 55.00元

本书面向实用,提供了大量网页设计与制作的细节图解,由浅入深地讲解网页制作的步骤与方法,同时介绍了Web标准以及使用目前流行的“层”布局方式,并结合多个实例讲解了采用层叠样式表与层布局相结合制作网页的方法。   本书给出了几大典型网页制作实例,包括小型企业网站、电子相册网站、网络电台、网上商店、旅游网站等,这些实例基本上覆盖到了常用的网页设计与制作知识。本书在详细讲解各个实例的过程中,不仅介绍......一起来看看 《别具光芒》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具