相关疑难解决方法(0)

非静态方法不能从静态上下文中引用

首先是一些代码:

import java.util.*;
//...

class TicTacToe 
{
//...

public static void main (String[]arg) 
{ 

    Random Random = new Random() ; 
    toerunner () ; // this leads to a path of 
                   // methods that eventualy gets us to the rest of the code 
} 
//... 

public void CompTurn (int type, boolean debug) 
{ 
//...

        boolean done = true ; 
        int a = 0 ; 
        while (!done) 
        { 
            a = Random.nextInt(10) ;
            if (debug) { int i = 0 ; while (i<20) …
Run Code Online (Sandbox Code Playgroud)

java static

17
推荐指数
1
解决办法
10万
查看次数

标签 统计

java ×1

static ×1