Computer Tips and Tricks

Sunday, October 4, 2020

write a java program creating static variables?

class static12 

{

int x=5;

int y=10;

static int z=7;

public static void main(String[] args) 

{

      static12  s1=new static12();

System.out.println(s1.x+s1.y);

         System.out.println(z);

}

}

 

Posted by vamsinath at 7:36 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

vamsinath
View my complete profile

Blog Archive

  • ▼  2020 (63)
    • ▼  October (12)
      • write python turtle program to draw letter E
      • write python turtle program for creating Archimede...
      • write a python program for creating a class Studen...
      • write a python program for creating class person w...
      • write a java program for demonstration of Finally ...
      • write a java program for exception propagation
      • write a java program for creating own exception
      • write a java program creating static variables?
      • write a java program using throw keyword ?
      • write a java program for generating arithmetic exc...
      • write a java program demonstrating relationship be...
      • write a java program for exhibiting multiple inher...
    • ►  August (24)
    • ►  May (26)
    • ►  April (1)
  • ►  2019 (1)
    • ►  February (1)
Simple theme. Powered by Blogger.