163 subscribers
3.42K photos
24 videos
39 files
371 links
Link: @java_posts

Contact: java.response.email@gmail.com
Download Telegram
And process() method and int[] ints in Processor are also overridden in the child class. Line 11 and line 28:
public class Processor {

public void process(int[] ints) { /* ... */ }

}

/* ... */

class MathProcessor extends Processor {

@Override
public void process(Object[] objs) { /* ... */ }

}
Overloading
The process() method is overloaded in the Processor class. Lines 7, 11, and 15:
public class Processor {

public void process(int i, int j) { /* ... */ }

public void process(int[] ints) { /* ... */ }

public void process(Object[] objs) { /* ... */ }

}
Conclusion
In this article, we covered overriding and overloading in Java. Overriding occurs when the method signature is the same in the superclass and the child class. Overloading occurs when two or more methods in the same class have the same name but different parameters.
Java pinned «Chapter 5: Object-Oriented Programming 1. Why OOP ? 2. Java Constructor 3. Accessing Parent Class Variables 4. The Java OOP Concepts 5. Abstraction 6. Encapsulation 7. Polymorphism 8. Inheritance 9. Association 10. Aggregation 11. Composition 12.…»
Instruction

Explore essential Java topics that assess comprehension of management concepts for building a solid foundation. Browse through the sorted topics and click to access the corresponding posts.
Java pinned «Instruction Explore essential Java topics that assess comprehension of management concepts for building a solid foundation. Browse through the sorted topics and click to access the corresponding posts.»