You never actually create a house object:
public class test{ private static house h; public static void main(String args[]) { h = new house(); h.players[3].setName("john"); }}
Random notes:
- If you look at the stack trace the exception gave you, it would have pointed you straight to the line in question.
- If there's multiple things going on on one line which is causing a problem, then split it across multiple lines.
- Class names should start with a capital letter.
- A hardcoded number of players is probably a bad idea.
- I suspect you really don't want player.name and player.setName to be static.