Ch 6: Functions & Modules in Programming

About This Chapter

If you're getting ready for a test or need a quick way to catch up in class, check out this engaging chapter on modules and functions in programming. The lessons and quizzes are accessible 24/7 on any mobile device or computer for convenient and flexible study.

Functions & Modules in Programming- Chapter Summary

This informative chapter is made up of concise and easy-to-understand lessons on modules and functions in programming. You'll review methods in Java; the purpose of a main method in Java; and private, protected and public Java keywords. Feel free to go back as many times as needed to review this information until you're confident. This resource is self-paced so you can utilize it at your leisure. One of our experts is available to answer any questions you might have. After you finish this chapter, you should be ready to:

  • Define final keyword in Java
  • Give examples of static methods in Java
  • Differentiate between non-static and static methods in Java
  • Use static methods in practical applications
  • Explain modular programming in Java
  • Use arrays as arguments to functions
  • Detail the application of recursion in Java
  • Differentiate between the methods for iteration and recursion
  • Outline recursion in Java as it applies to data structures

9 Lessons in Chapter 6: Functions & Modules in Programming
Test your knowledge with a 30-question chapter practice test
Methods in Java: Definition & Example

1. Methods in Java: Definition & Example

Java programs have methods that have a name and contain a set of statements or instructions. In this lesson, we'll learn how the Java programming language uses methods and the rules and syntax we need to employ when using them.

What is a Main Method in Java? - Definition & Purpose

2. What is a Main Method in Java? - Definition & Purpose

In this lesson you will learn about the special Java method named 'main', the meaning of the arguments passed into it, and how to use them to get your program running smoothly.

Java Keywords: Protected, Public & Private

3. Java Keywords: Protected, Public & Private

Java is great at protecting objects. What does it mean to protect an object? Protected, public and private are keywords used to control access. This lesson will define the concepts and provide real-world examples.

Java: Final Keyword

4. Java: Final Keyword

...And that's final! The final keyword in Java is a simple tool, but it is the programming equivalent of these words. This lesson will cover the concept of Final and provide some real-world examples how how to use the final keyword to protect and clean Java code.

Static vs. Non-Static Methods in Java

5. Static vs. Non-Static Methods in Java

In Java, a static method belongs to the class. A non-static method, on the other hand, belongs to an object of a class. In this lesson, we will learn more about static and non-static methods in Java.

Practical Application for Java: Using Static Methods

6. Practical Application for Java: Using Static Methods

In this practical application, you will create a program that utilizes a static method. You will modify the application so that it allows arguments to be passed to a method, which will return a value to the calling function.

Recursion in Java: Application & Examples

7. Recursion in Java: Application & Examples

In this lesson, you will learn how to apply recursion in Java. We will cover several methods for recursion, including factorials, Fibonacci series, and the Tower of Hanoi game. Working code examples are provided.

Methods for Recursion vs. Iteration in Java

8. Methods for Recursion vs. Iteration in Java

We can use the techniques of recursion and iteration in our Java programs to manipulate data and perform repetitive operations. Knowing when to use each technique is as important as knowing how to program each one.

Practical Application for Data Structures: Recursion in Java

9. Practical Application for Data Structures: Recursion in Java

In this practical lesson, you will create an algorithm that uses recursion to calculate factorials. You will be able to build, compile, run, and test your program.

Chapter Practice Exam
Test your knowledge of this chapter with a 30 question practice chapter exam.
Not Taken
Practice Final Exam
Test your knowledge of the entire course with a 50 question practice final exam.
Not Taken

Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Support