The built-in print() method

Let’s start building the project using built-in methods. We’ve already seen some built-in methods, and we know that a method does the following things:

  1. It takes something as its input.

  2. It processes this input to create some output.

  3. It returns the output.

The most prominent Java built-in method that prints something on the screen is print. It prints anything we give as input on the screen. But this method belongs to a class called System.out, meaning we must write System.out.print() to call this method. For instance, guess the result of the following code when we press the “Run” button.

Create a free account to access the full course.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy