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.
我试图从java中的另一个类调用方法,当调用方法时我想将日期变量传递给方法,我该怎么做?我在做什么是对的吗?
代码:
功能:
public static int search(java.util.Date date) { }
像这样调用函数:
Date dt = new Date(); search(dt);
并遵循@Uwe Plonus 的建议 - 阅读教程。