Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is a function?
Think of where you define a reusable block of instructions.
Give an example of a library function in Java.
It's a function in the Math library.
What is the purpose of a function in programming?
Think about code organization.
True or False: A pure function can cause side effects.
Consider what happens when you call the function when the same inputs are used.
Create a user-defined function that computes the factorial of a given number. Explain how you would handle errors such as negative numbers.
Think about the base condition for recursion.
Write a pure function that checks if a number is even or odd. Explain why it's classified as pure.
Consider repeating results when using the same input.
5 more questions in this section. Enroll free to practise them all.
Enroll free