【问题标题】:how to compile this Code and print the Result? [closed]如何编译此代码并打印结果? [关闭]
【发布时间】:2013-06-05 22:41:47
【问题描述】:

下面的java代码不会运行,我想通过编译这段代码知道结果!

    class ParseInt{
        static void main(String [] a){
            int b=Integer.parseInt(a[0]);
            int m = Integer.MIN_VALUE;
            for (int i=0; i<32; i++){
                System.out.print(( b & m >>> i )== 0 ? "0" : "X");
                //System.out.print(((b &(m >>> i))== 0)? "0" : "X");
            }
        }
    }

【问题讨论】:

  • 错误信息?输入值?

标签: java compilation


【解决方案1】:

您的主要方法需要公开。更重要的是,它需要符合签名:

public static void main(String[] a)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-10
    • 1970-01-01
    • 1970-01-01
    • 2017-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-05
    相关资源
    最近更新 更多