Results 1 to 2 of 2

Thread: [RESOLVED] returning some class variable

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Resolved [RESOLVED] returning some class variable

    Code:
    public class GameData {
    
        public int[][] tictactoe_board;
        
    
        // Constructor
        public GameData(int[][] board) {
    	tictactoe_board = board;
        } 
    }
    is there any way i can return the tictactoe_board variable in another class? like

    int[][] blah = GameData.tictactoe_board;

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: returning some class variable

    declare the "tictactoe_board" static
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width