Javaでreturn文を実行します

ラウィテジャSRIPALLI:

私の所望の出力は、あなたを印刷することであるあなたが私たちの条件の下で、このアプリケーションを使用することを拒否してきた主な方法@@@@である後ほど再度お試しくださいしかし、私のreturn文はアム私は不足しているどのようなものを印刷しないのですか?ここに私のコードです

クラスデモ{文字列applicationOutput(int型eeter){

    if (eeter == 1 )
    {
    System.out.println("You have opted to use this application underour terms");
        return "success and come";
    }
    else
    {
     System.out.println("@@@@You have declined to use this application under our terms");
        return"please try again later";

    }

 }  

}クラスDEMO1 {

 public static void main (String[] args)
    {
        System.out.println("You are in the main method");

demo d = new demo();
d.applicationOutput(0);
        }
}

実際のO / P; あなたはあなたが私たちの条件の下で、このアプリケーションを使用することを拒否してきた主な方法@@@@です

アラン:

メインでは、印刷要素を追加する必要があります。

System.out.println(d.applicationOutput(0));

私はあなたの方法で1つのリターン、このような何かを持っているあなたに助言します:

String applicationOutput(int eeter) {
    String messageReturn = "";
    if (eeter == 1 )
    {
       System.out.println("You have opted to use this application underour terms");
       messageReturn=  "success and come";
    }
    else
    {
        System.out.println("@@@@You have declined to use this application under our terms");
        messageReturn = "please try again later";

    }
    return messageReturn;

 }  

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=339151&siteId=1