小编Oog*_*uro的帖子

为什么我的方法没有返回任何东西?

为什么我的方法没有返回任何东西?

class Test{
    static int count = 0;


    public static void main(String args[]){

    String s = "------+    # ----+------";
        countDoors(s);

    }

    public static int countDoors(String s){
        char sigN= '+';


        for(int i=0;i<s.length();i++)

            if(s.charAt(i)==sigN)
                count++;


        return count;

    }


}
Run Code Online (Sandbox Code Playgroud)

我肯定有点菜鸟的问题,但我真的想明白为什么它不起作用

java algorithm

-4
推荐指数
1
解决办法
1517
查看次数

标签 统计

algorithm ×1

java ×1