Skip to Main Content
Java
book

Java

by Michael Sikora
January 2003
Beginner to intermediate content levelBeginner to intermediate
150 pages
7h 28m
English
Morgan Kaufmann
Content preview from Java
m
4.5 Argument Passing
in
Java
39
4.4 Method Overloading
Method overloading is a feature common to most object-oriented programming languages and
is one aspect of polymorphism. This allows us to have methods with the same identifier but
with different argument lists. The argument lists can have a different ordering of data types
or can have a different number of arguments. In the Account class, in addition to the deposit
method we have already seen (lines 12-14), we could also add a second deposit method that
prints the balance if it exceeds a supplied level.
public void deposit(double amount, double level) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Programming

Java Programming

Poornachandra Sarang
JAVA Programming

JAVA Programming

K. Rajkumar
Java Programming

Java Programming

Hari Mohan Pandey
Java 9 for Programmers

Java 9 for Programmers

Paul J. Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781558609099