interface customer
{
int a=20;
void purchase();
}
class Owner implements customer
{
@Override
public void purchase()
{
System.out.println("customer bought "+a + "kg");
}
}
class A
{
public static void main(String[] args)
{
System.out.println(customer.a+"kg");/* it can be call without making an obj that is why its static*/
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter