SlideShare a Scribd company logo
//Ques. 8 WAP on function overloading?

class sum
{
void add(inta,int b)
{
System.out.println("nSum is: "+(a+b));
}
void add(inta,intb,int c)
{
System.out.println("Sum is: "+(a+b+c));
}
void add(inta,float b)
{
System.out.println("Sum is: "+(a+b));
}
}
class overloading
{
public static void main(String arg[])
{
sum c=new sum();
c.add(5,4);
c.add(29,33,22);
c.add(6,4f);
}
}
OUTPUT:-

More Related Content

PDF
Altitude San Francisco 2018: WebAssembly Tools & Applications
Fastly
 
DOCX
Conversion of data types in java
One97 Communications Limited
 
PPTX
2 19-2018-mean of all runs
Alexander Bitar
 
DOCX
Doubly linklist
ilsamaryum
 
PDF
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
Deltares
 
DOCX
Control system lab nyquist plot
kawsarmahmud8
 
PDF
10 - Scala. Co-product type (sum type)
Roman Brovko
 
PDF
Network Analysis with networkX : Real-World Example-2
Kyunghoon Kim
 
Altitude San Francisco 2018: WebAssembly Tools & Applications
Fastly
 
Conversion of data types in java
One97 Communications Limited
 
2 19-2018-mean of all runs
Alexander Bitar
 
Doubly linklist
ilsamaryum
 
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
Deltares
 
Control system lab nyquist plot
kawsarmahmud8
 
10 - Scala. Co-product type (sum type)
Roman Brovko
 
Network Analysis with networkX : Real-World Example-2
Kyunghoon Kim
 

What's hot (20)

PDF
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
indiangarg
 
PPTX
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
DOC
Shan
mohdshanu
 
PDF
C programs Set 2
Koshy Geoji
 
PDF
Optimizing the Grafana Platform for Flux
InfluxData
 
TXT
Simulador carrera de caballos desarrollado en C++
Santiago Sarmiento
 
PDF
Goの時刻に関するテスト
Kentaro Kawano
 
TXT
Uts
pencari buku
 
ODP
Use of django at jolt online v3
Jaime Buelta
 
PPTX
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
InfluxData
 
PPTX
Queue oop
Gouda Mando
 
DOCX
Wap to implement bitwise operators
Harleen Sodhi
 
PDF
Write a program to show the example of hybrid inheritance.
Mumbai B.Sc.IT Study
 
PDF
Om (Cont.)
Taku Fukushima
 
DOCX
Java Code for Sample Projects Methods
jwjablonski
 
DOCX
Array using recursion
Swarup Boro
 
PDF
Mangling Ruby with TracePoint
Mark
 
PDF
Activity Recognition Through Complex Event Processing: First Findings
Sylvain Hallé
 
DOC
Labsheet_3
rohassanie
 
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
indiangarg
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
Shan
mohdshanu
 
C programs Set 2
Koshy Geoji
 
Optimizing the Grafana Platform for Flux
InfluxData
 
Simulador carrera de caballos desarrollado en C++
Santiago Sarmiento
 
Goの時刻に関するテスト
Kentaro Kawano
 
Use of django at jolt online v3
Jaime Buelta
 
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
InfluxData
 
Queue oop
Gouda Mando
 
Wap to implement bitwise operators
Harleen Sodhi
 
Write a program to show the example of hybrid inheritance.
Mumbai B.Sc.IT Study
 
Om (Cont.)
Taku Fukushima
 
Java Code for Sample Projects Methods
jwjablonski
 
Array using recursion
Swarup Boro
 
Mangling Ruby with TracePoint
Mark
 
Activity Recognition Through Complex Event Processing: First Findings
Sylvain Hallé
 
Labsheet_3
rohassanie
 
Ad

Viewers also liked (8)

PPTX
Overloading
gemini1420
 
PPTX
12. session 12 java script objects
Phúc Đỗ
 
PDF
Inside Javascript Objects
anandology
 
DOCX
Constructor Overloading in java
One97 Communications Limited
 
PPT
Sankar.presentation1.accountancy
Rohitbhakta
 
PPT
Java Programming - Introduction to Abstract Class
Oum Saokosal
 
PDF
बेसिक जावा प्रोग्रामिंग हिंदी में
Chand Rook
 
PPT
Introduction to Basic Accounting Concept
Kamrul Hasan
 
Overloading
gemini1420
 
12. session 12 java script objects
Phúc Đỗ
 
Inside Javascript Objects
anandology
 
Constructor Overloading in java
One97 Communications Limited
 
Sankar.presentation1.accountancy
Rohitbhakta
 
Java Programming - Introduction to Abstract Class
Oum Saokosal
 
बेसिक जावा प्रोग्रामिंग हिंदी में
Chand Rook
 
Introduction to Basic Accounting Concept
Kamrul Hasan
 
Ad

More from One97 Communications Limited (20)

DOCX
Er. Model Of Hospital Management
One97 Communications Limited
 
DOCX
Fcfs Cpu Scheduling With Gantt Chart
One97 Communications Limited
 
PPTX
Neural Interfacing
One97 Communications Limited
 
PPT
Blue eye technology
One97 Communications Limited
 
PPTX
Computer Forensics
One97 Communications Limited
 
PPTX
Protect Folders without using any Software
One97 Communications Limited
 
PPTX
Introduction to Java Programming
One97 Communications Limited
 
DOCX
WAP to invoke constructors using super keyword in java
One97 Communications Limited
 
DOCX
WAP to find out whether the number is prime or not in java
One97 Communications Limited
 
DOCX
Overriding abstract in java
One97 Communications Limited
 
DOCX
How to achieve multiple inheritances by using interface in java
One97 Communications Limited
 
DOCX
Method overriding in java
One97 Communications Limited
 
DOCX
WAP to implement inheritance and overloading methods in java
One97 Communications Limited
 
DOCX
Program on usage of Final keyword in java
One97 Communications Limited
 
DOCX
WAP to initialize different objects with different values in java
One97 Communications Limited
 
Er. Model Of Hospital Management
One97 Communications Limited
 
Fcfs Cpu Scheduling With Gantt Chart
One97 Communications Limited
 
Neural Interfacing
One97 Communications Limited
 
Blue eye technology
One97 Communications Limited
 
Computer Forensics
One97 Communications Limited
 
Protect Folders without using any Software
One97 Communications Limited
 
Introduction to Java Programming
One97 Communications Limited
 
WAP to invoke constructors using super keyword in java
One97 Communications Limited
 
WAP to find out whether the number is prime or not in java
One97 Communications Limited
 
Overriding abstract in java
One97 Communications Limited
 
How to achieve multiple inheritances by using interface in java
One97 Communications Limited
 
Method overriding in java
One97 Communications Limited
 
WAP to implement inheritance and overloading methods in java
One97 Communications Limited
 
Program on usage of Final keyword in java
One97 Communications Limited
 
WAP to initialize different objects with different values in java
One97 Communications Limited
 

Recently uploaded (20)

PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
PPTX
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
CDH. pptx
AneetaSharma15
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 

program on Function overloading in java

  • 1. //Ques. 8 WAP on function overloading? class sum { void add(inta,int b) { System.out.println("nSum is: "+(a+b)); } void add(inta,intb,int c) { System.out.println("Sum is: "+(a+b+c)); } void add(inta,float b) { System.out.println("Sum is: "+(a+b)); } } class overloading { public static void main(String arg[]) { sum c=new sum(); c.add(5,4); c.add(29,33,22); c.add(6,4f); } }