Write a program to Static and Non-Static in Java.

 

Output: