SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
//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:-

Contenu connexe

Tendances

Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)indiangarg
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2Koshy Geoji
 
Optimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for FluxOptimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for FluxInfluxData
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Santiago Sarmiento
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテストKentaro Kawano
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3Jaime Buelta
 
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob LisiUsing Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob LisiInfluxData
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operatorsHarleen Sodhi
 
Write a program to show the example of hybrid inheritance.
Write a program to show the example of hybrid inheritance.Write a program to show the example of hybrid inheritance.
Write a program to show the example of hybrid inheritance.Mumbai B.Sc.IT Study
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methodsjwjablonski
 
Array using recursion
Array using recursionArray using recursion
Array using recursionSwarup Boro
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePointMark
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Sylvain Hallé
 

Tendances (20)

Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
Some Commonly asked Function/Objects Vs. header files (CBSE 12th Exam)
 
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAMPROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
PROGRAMMING USING C# .NET - SARASWATHI RAMALINGAM
 
Shan
ShanShan
Shan
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Optimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for FluxOptimizing the Grafana Platform for Flux
Optimizing the Grafana Platform for Flux
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテスト
 
Uts
UtsUts
Uts
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3
 
ECMAScript 5: Новое в JavaScript
ECMAScript 5: Новое в JavaScriptECMAScript 5: Новое в JavaScript
ECMAScript 5: Новое в JavaScript
 
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob LisiUsing Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
 
Queue oop
Queue   oopQueue   oop
Queue oop
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operators
 
Write a program to show the example of hybrid inheritance.
Write a program to show the example of hybrid inheritance.Write a program to show the example of hybrid inheritance.
Write a program to show the example of hybrid inheritance.
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
Array using recursion
Array using recursionArray using recursion
Array using recursion
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePoint
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 

En vedette

12. session 12 java script objects
12. session 12   java script objects12. session 12   java script objects
12. session 12 java script objectsPhúc Đỗ
 
Inside Javascript Objects
Inside Javascript ObjectsInside Javascript Objects
Inside Javascript Objectsanandology
 
Sankar.presentation1.accountancy
Sankar.presentation1.accountancySankar.presentation1.accountancy
Sankar.presentation1.accountancyRohitbhakta
 
Java Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract ClassJava Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract ClassOum Saokosal
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में Chand Rook
 
Introduction to Basic Accounting Concept
Introduction to Basic Accounting ConceptIntroduction to Basic Accounting Concept
Introduction to Basic Accounting ConceptKamrul Hasan
 

En vedette (8)

Overloading
Overloading Overloading
Overloading
 
12. session 12 java script objects
12. session 12   java script objects12. session 12   java script objects
12. session 12 java script objects
 
Inside Javascript Objects
Inside Javascript ObjectsInside Javascript Objects
Inside Javascript Objects
 
Constructor Overloading in java
Constructor Overloading in javaConstructor Overloading in java
Constructor Overloading in java
 
Sankar.presentation1.accountancy
Sankar.presentation1.accountancySankar.presentation1.accountancy
Sankar.presentation1.accountancy
 
Java Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract ClassJava Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract Class
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
 
Introduction to Basic Accounting Concept
Introduction to Basic Accounting ConceptIntroduction to Basic Accounting Concept
Introduction to Basic Accounting Concept
 

Plus de One97 Communications Limited

WAP to invoke constructors using super keyword in java
WAP to invoke constructors using super keyword in javaWAP to invoke constructors using super keyword in java
WAP to invoke constructors using super keyword in javaOne97 Communications Limited
 
WAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaWAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaOne97 Communications Limited
 
How to achieve multiple inheritances by using interface in java
How to achieve multiple inheritances by using interface in java How to achieve multiple inheritances by using interface in java
How to achieve multiple inheritances by using interface in java One97 Communications Limited
 
WAP to implement inheritance and overloading methods in java
WAP to implement inheritance and overloading methods in javaWAP to implement inheritance and overloading methods in java
WAP to implement inheritance and overloading methods in javaOne97 Communications Limited
 
WAP to initialize different objects with different values in java
WAP to initialize different objects with different values in javaWAP to initialize different objects with different values in java
WAP to initialize different objects with different values in javaOne97 Communications Limited
 

Plus de One97 Communications Limited (20)

Er. Model Of Hospital Management
Er. Model Of Hospital ManagementEr. Model Of Hospital Management
Er. Model Of Hospital Management
 
Financial
FinancialFinancial
Financial
 
Railway
RailwayRailway
Railway
 
Library
LibraryLibrary
Library
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
Neural Interfacing
Neural Interfacing Neural Interfacing
Neural Interfacing
 
Blue eye technology
Blue eye technology Blue eye technology
Blue eye technology
 
Computer Forensics
Computer ForensicsComputer Forensics
Computer Forensics
 
Backtrack
BacktrackBacktrack
Backtrack
 
Protect Folders without using any Software
Protect Folders without using any SoftwareProtect Folders without using any Software
Protect Folders without using any Software
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Topology
TopologyTopology
Topology
 
WAP to invoke constructors using super keyword in java
WAP to invoke constructors using super keyword in javaWAP to invoke constructors using super keyword in java
WAP to invoke constructors using super keyword in java
 
WAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaWAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in java
 
Overriding abstract in java
Overriding abstract in javaOverriding abstract in java
Overriding abstract in java
 
How to achieve multiple inheritances by using interface in java
How to achieve multiple inheritances by using interface in java How to achieve multiple inheritances by using interface in java
How to achieve multiple inheritances by using interface in java
 
Method overriding in java
Method overriding in javaMethod overriding in java
Method overriding in java
 
WAP to implement inheritance and overloading methods in java
WAP to implement inheritance and overloading methods in javaWAP to implement inheritance and overloading methods in java
WAP to implement inheritance and overloading methods in java
 
Program on usage of Final keyword in java
Program on usage of  Final keyword in javaProgram on usage of  Final keyword in java
Program on usage of Final keyword in java
 
WAP to initialize different objects with different values in java
WAP to initialize different objects with different values in javaWAP to initialize different objects with different values in java
WAP to initialize different objects with different values in java
 

Dernier

HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxKatherine Villaluna
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 

Dernier (20)

HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 

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); } }