The document contains code for two Java programs: 1) A method overloading example showing a class with two methods named "operation" that take in different parameters (int vs double) and return different types, and are called to demonstrate overloading. 2) A method overriding example with a parent "solar_system" class and child "planet" class, where the child class overrides the parent's method to output a different message.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views2 pages
Kalpesh 8
The document contains code for two Java programs: 1) A method overloading example showing a class with two methods named "operation" that take in different parameters (int vs double) and return different types, and are called to demonstrate overloading. 2) A method overriding example with a parent "solar_system" class and child "planet" class, where the child class overrides the parent's method to output a different message.