Saturday 31 October 2015

Simple Static program for Java

import java.io.*;
class demo
{
static int a=42;
static int b=99;
public static void callme()
{
System.out.println("a="+a);
}
}
class sample
{
public static void main(String args[])
{
demo.callme();
System.out.println("b="+demo.b);
}
}

No comments:

Post a Comment