Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
メソッド A の戻り値をメソッド B のパラメーターとして Java で使用したい場合、どのようにすればよいでしょうか? たとえば、メソッド A は今日が晴れか曇りかを返し、メソッド B はその月の晴れた日の割合を見つけます。
この方法で試してください...
public void chkIt(doIt()){ System.out.println(doIt()); // But then you will unnecessarily call it twice. } public boolean doIt(){ return true; }