Thursday 20 November 2014

Method Overloading

What is Method overloading?
                                    A class is have two or more methods having same name,but their argument lists are different(Number of Parameters,data type of paraameters,Sequence of Data type of parameters) it is called method overloading.
It is also known as Static Polymorphism.
Advantages: It increases the readability of the program
--------------------------------------------------------------
Example 1: Different number of parameters in the argument list
class calc
{
void add(int a,int b)
{
System.out.pritnln(a+b);
}
void add(int a,int b,int c)
{
System.out.pritnln(a+b+c);
}
public static void main(String args[])
{
calc obj1=new calc();
obj1.add(10,20,30);
obj1.add(10,20);
}
}
OUTPUT:60
             30
--------------------------------------------------------------
Example 2: Difference in data type of argument 
class calc
{
void add(int a,int b)
{
System.out.pritnln(a+b);
}
void add(float a,float b )
{
System.out.pritnln(a+b);
}
public static void main(String args[])
{
calc obj1=new calc();
obj1.add(10.5,10.5)
obj1.add(10,20);
}
}
OUTPUT:21
             30
--------------------------------------------------------------






Wednesday 19 November 2014

OOPS CONCEPTS IN JAVA




1.Method overloading  2. Method overriding  3. Exception handling 
4. Method overloading vs Overriding   5. Constructors 6. Constructor overloading
7. private constructor 8. Constructors in interfaces 9. Constructor chaining
10. Aggregation 11. Association 12. OOPs basics
13. Polymorphism in java   14. Types of polymorphism 15. Inheritance
16. Types of inheritance 17. Hybrid inheritance 18. Hierarchical inheritance
19. Multilevel inheritance 20. Multiple inheritance 21. Encapsulation
22. Static and dynamic binding in java 23. Static class 24. Static methods
25. Static variables 26. Static import 27. Static constructor
28. Inner classes 29. Abstract class and methods 30. Interfaces in java
31. Abstract class vs interface 32. Access modifiers 33. Packages in java
34. Final Keyword 35. Super keyword

HOW TO STOP WINDOWS 10 AUTO UPDATE