• 1000 *
class Parent {
public String pet()
{
return "Avish";
}}
class Inherit extends Parent {
public static void main(String s[])
{
public String pet(new Inherit().pet()) // this is a method where I want to use Avish as //parameter how can I do that
{
System.out.println();}}}
[1]: https://i.stack.imgur.com/5IcnE.png