Functions, typically called methods, in Java allow you to group a set of tasks and give them a name. In this video, see how to create several types of Java functions. Topics include static or class functions, instance methods, parameter functions, and functions that return values.
- A method is a function or block of code … that's attached to a class. … Let's review how to create methods in this movie. … So, I'm going to define a method … that is static. … So I'm going to type the word static void … and this is going to be called print s - for static … and it will receive a string which we'll call data. … And it's going to call … system.out.print line … passing in the data. … So it's simply a shortcut to print code. … So, inside of our main method we'll run print s, … by typing printS … and then passing in a string. … So the string'll be static method but it could be … anything you want for now. … Make sure to add that semi-colon. … Run the application and you should get static method. … So, the difference between a static and … a non-static method is that a static method is attached to … a class and a non-static method is attached to an … instance of a class. … In other words, print s being called from here is a shortcut … for review.printS. … So, when we run that, we get the same result, but we …
Author
Released
3/21/2019- Installing Java
- Choosing an IDE
- Creating a Java class
- Java language basics
- Creating a UI with Swing
- Storing data in tables and arrays
- Publishing and using JAR files
- Creating a JPS project
- Writing server-side Java
- Developing Android apps with Java
Skill Level Beginner
Duration
Views
Related Courses
-
Java Essential Training for Students
with Peggy Fisher3h 6m Intermediate -
Java Essential Training: Syntax and Structure
with David Gassner3h 12m Intermediate -
Learning Java (2018)
with Kathryn Hodge2h 11m Beginner -
Java Essential Training: Objects and APIs
with David Gassner2h 49m Intermediate
-
Introduction
-
1. Install Java and an IDE
-
Pick a Java IDE2m 35s
-
Install Eclipse1m 9s
-
Eclipse setup3m 43s
-
Create a Java class4m 36s
-
-
2. Java Basics Review
-
Variables3m 26s
-
Functions3m 27s
-
Arrays4m 47s
-
Conditional statements4m 43s
-
Classes5m 44s
-
Input and output2m 51s
-
Read data from a file5m 46s
-
Handle Java errors3m 9s
-
-
3. Create a User Interface with Swing
-
Install Swing tools1m 45s
-
Swing basics4m 3s
-
Layout tools4m 3s
-
Labels and buttons3m 6s
-
Connect UI elements to code4m 16s
-
Check boxes3m 36s
-
Radio buttons2m 27s
-
Listener classes7m 12s
-
-
4. Tables and Data Sources
-
Tables5m 13s
-
Scroll a table2m 30s
-
-
5. Distribution and Deployment
-
Publish a runnable JAR file1m 48s
-
-
6. Server-Side Java: JSP
-
Install Java EE1m 26s
-
Install Tomcat56s
-
Create a JSP project3m 11s
-
Write server-side Java2m 36s
-
-
7. Android Development
-
Conclusion
-
Next steps1m 27s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Functions