What is the purpose of having a class inside a constructor? Java -


what purpose of having board class inside of computer class constructor be? called in programming? how use assign variable, arrays, methods, integers, etc?

board board = new board();   player computer = new player(board, "x");  

well, information you've given.. here's best explanation. "player" class constructor allow "board" come in , set up. "board" class reliant on class , need object for. instance, object "board" contains constructor well. inside "boards" constructor might contain "variables, arrays, method integers, etc.", "players" constructor could. "computer" going inherit object "board" if it's declared in constructor. although, in situation sense it's passed parameter it's going used set 1 of variables within "player" constructor. call "inheritance", "sending object parameter", object-oriented programming.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -