Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- float average(float a, float b, float c) {
- return (a+b+c)/3;
- }
- float average(float a, float b, float c, float d, float e) {
- return (a+b+c+d+e)/5;
- }
- public static void main(String args[]) {
- MyClass obj = new MyClass();
- System.out.println("Average of 1+2+3 = " + obj.average(1,2,3));
- System.out.println("Average of 1+2+3+4+5 = " + obj.average(1,2,3,4,5));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement