课程: Java 8+ Essential Training: Objects and APIs
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Wrap code in static methods - Java教程
课程: Java 8+ Essential Training: Objects and APIs
Wrap code in static methods
- [Instructor] Most programming languages let you create reusable code, code blocks that you can call from multiple places in an application. These are sometimes called functions or subroutines in other languages, but in Java they're called methods, and they're always declared as members of a class. Each method starts with one or more declarations. The methods return type is required. The main method that starts up a command line application has a return type of void, meaning that it doesn't return anything. This is something that might be called a subroutine in other languages, but it's simply called a method in Java. The keyword public is an access modifier. It determines the visibility of this method to the rest of the application. The public access modifier means it can be called from anywhere. Other access modifiers include private and protected, and the absence of an access modifier has its own meaning. Static means that this method can be called directly from the class without…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
(已锁定)
About encapsulation3 分钟 46 秒
-
Use the Java runtime classes4 分钟 45 秒
-
(已锁定)
Wrap code in static methods5 分钟 56 秒
-
(已锁定)
Declare and use custom classes4 分钟 9 秒
-
(已锁定)
Organize code with packages3 分钟 46 秒
-
(已锁定)
Create and use instance methods2 分钟 27 秒
-
(已锁定)
Manage state with instance variables7 分钟 31 秒
-
(已锁定)
Declare multiple constructor methods5 分钟 2 秒
-
(已锁定)
Use static fields as constants5 分钟 51 秒
-
(已锁定)
Declare and use enum types3 分钟 44 秒
-
(已锁定)
Organize code with nested types4 分钟 15 秒
-
(已锁定)
-
-
-
-
-