0

What is the difference between static member and instance member of class?

8/23/2019 5:17:55 PM

Ashra Khan

1 Answer

New Answer

0

static members are shared across all instances, and the class can accesd it too. So: class Hoomen { static int numberz = 3; int aeg; Hoomen(int i) { aeg = i; } } class Program { publuc static void main(String[] args) { System.out.println(Hoomen.numberz); // 3 Hoomen men = new Hoomen(8); Hoomen.numberz = 10; System.out.println(men.numberz); // 10 } }