【发布时间】:2022-09-23 15:47:17
【问题描述】:
class V
{
void print_V(int number)
{
String v= \"v\";
int count= number;
System.out.print(\"Letter\" + v.repeat(count));
}
void print_V()
{
System.out.print(\"v\");
}
public static void call_Print_V(int n)
{
print_V(n);
}
}
class Main
{
public static void main(String[] args)
{
v call_Print_V= new v();
call_Print_V.print_V(input);
}
}
我尝试在互联网上搜索如何创建实例方法,但发现它们都没有帮助。我尝试以与我找到的示例类似的方式格式化实例方法,但我仍然无法调用我的方法。
-
这看起来更像是 Java 而不是 JavaScript。