From the course: Learning Java 11
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Calling functions in Java - Java Tutorial
From the course: Learning Java 11
Calling functions in Java
- [Instructor] Now that we've defined our announceDeveloperTeaTime function we can proceed to the second step of using functions in Java. We just write the name of the function to use or execute the steps within the function. In java, when we use a function, we say we call the function. You can think of this as recalling the steps that were previously defined and executing them. Let's call a function in Java. We define our function outside of the main function but we are going to call or use our function inside of the main function. The main function is where the meat of our program gets executed but we can always recall functions that are previously defined as part of the program. Our announceDeveloperTeaTime function is one of these functions. In our main function we can write announceDeveloperTeaTime. This will called the announceDeveloperTeaTime function, execute its steps and then continue to execute whatever is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
What are functions? (conceptually)4m 25s
-
(Locked)
Defining functions in Java3m 28s
-
(Locked)
Calling functions in Java5m 9s
-
(Locked)
Parameters in Java5m 30s
-
(Locked)
Return types in Java5m 34s
-
(Locked)
Using built-in functions in Java4m 43s
-
(Locked)
Solution: Move capital letters2m 27s
-
(Locked)
-
-