Java Tutorial #26🔴METHOD OVERLOADING | METHODS | Tagalog | English | Filipino | 2021

preview_player
Показать описание
Java Tutorial #26🔴METHOD OVERLOADING | USER DEFINED METHODS | Tagalog | English | Filipino | 2021. In this episode you will learn three different ways on how to Overload Methods in Java, having DIFFERENT NUMBER OF PARAMETERS, DIFFERENT DATA TYPE OF PARAMETERS, and DIFFERENT SEQUENCE OF DATA TYPES OF PARAMETERS. If two methods have same name, same parameters and have different return type, then this is not a valid method overloading. Method Overloading happens when a class has two or more methods by the same name but different parameters. If we have to perform only one operation, having same name of the methods increases the readability of the program., and that is the advantage of Method Overloading in Java.

In this episode, you will also learn how to overload main() methods. You can have any number of main methods in a class by method overloading, but Java Virtual Machine (JVM) calls main() method which receives string array as arguments only.

You will also learn different Data Types Promotion. One Data type is promoted to another implicitly if no matching Data type is found. If there are matching type arguments in the method, type promotion is not performed. If there are no matching type arguments in the method, and each method promotes similar number of arguments, there will be ambiguity and will result to compile time error. Example of Type Promotion:
🔷 byte → short → int → long
🔷 short → int → long → float → double
🔷 int → long → float → double
🔷 float → double
🔷 long → float → double
🔷 char → int → long → float → double (a = 97) ASCII code equivalent

🔴★★★INSTAGRAM LINK ★★★🔴
FOLLOW US ON INSTAGRAM:

⌚ Timestamps ⌚
00:00 Introduction
01:02 Method Overloading: Different Number of Parameters
08:06 Method Overloading: Different Data Types of Parameters
11:37 Method Overloading: Different Sequence of Data Types of Parameters
15:28 Valid | Invalid Cases Of Method Overloading Exercise
20:00 Overloading Main Methods
23:46 Method Overloading and Type Promotion
31:30 Wrap Up
32:49 OUTRO

👋Topics Covered 👋
🔷 Method Overloading: Different Number of Parameters
🔷Method Overloading: Different Sequence of DataTypes of Parameters
🔷Method Overloading: Different Data Types of Parameters
🔷Overloading Main Method
🔷Method Overloading and Type Promotion
🔷Void Methods
🔷Value Returning Methods
🔷 Static and Non Static Methods
🔷 Calling Void Methods
🔷 Calling Value Returning Methods

🔴★★★CHANNEL LINK ★★★🔴
Show Your Love By Subscribing And Sharing This Link:

#thecodingchannelph
Рекомендации по теме
Комментарии
Автор

Show Your Love By Dropping a commnent here

thecodingchannelph
Автор

masakit na po ulo ko hehehe bukas na naman ulit

irandonlaureta
Автор

Sir paano gamitin c parameter kapag may userInput na po. meron po ba kayong sample codes or tutorial po..Salamat.

bryanbalantes
Автор

what if I want the number of parameters specified only using scanner instead?

johnkt