Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An example which shows how static functions in java have all the variables act as static within them
* An example which shows how Static functions can be used in java
* available on Url :
public class HelloWorld{
public static void main(String []args){
System.out.println("Start Function");
Student st = new Student();"oldName";
System.out.println("name = "+;
System.out.println("name = "+;
System.out.println("See how name changed. Static functions have static variables inside them. ;)");
public static void processor(Student st){"newName";
class Student{
public String name;
public int age;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.