O'Reilly logo

JAVA Programming by K. Rajkumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Methods in Java

OBJECTIVES
  • To introduce Java method definition and method invocation
  • To implement Big2 application to understand methods
  • To explain passing primitive data types to methods with AreaFunction application
  • To generate prime numbers
  • To introduce the power of recursion with factorial function
  • To explain the pitfalls of recursion with Fibonacci function
  • To design overloaded methods
  • To explain method overloading with AdditionCalculator application
  • To illustrate passing one-dimensional arrays to methods using SortNumbers applications
  • To define sort() method with String array as an argument
  • To explain passing two-dimensional arrays to methods with Recipes application
4.1 INTRODUCTION

A method is a set of Java statements, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required