public class Test {
static boolean foo(char c){
System.out.println(c);
return true;
}
public static void main(String[] args){
int i =0 ;
for(foo('A'); foo('B')&&(i<2); foo('C')){
i++;
foo('D');
}
}
}请各位大虾给该一下错
static boolean foo(char c){
System.out.println(c);
return true;
}
public static void main(String[] args){
int i =0 ;
for(foo('A'); foo('B')&&(i<2); foo('C')){
i++;
foo('D');
}
}
}请各位大虾给该一下错
import java.util.*;public class Test
{
static boolean foo(char c)
{
System.out.println(c);
return true;
} public static void main(String[] args)
{
int i =0 ;
for(foo('A'); foo('B')&&(i<2); foo('C'))
{
i++;
foo('D');
}
}
}
public static void main (String[] args) {
int i=0;
for(bool('A');bool('B')&&i<2;bool('C')){
i++;
bool('D');
}
} static boolean bool(char af){
System.out.println(af);
return true;
}没有错。。估计是你在哪里拷贝的吧重新打一遍。。就可以了
static boolean foo(char c) {
System.out.println(c);
return true;
} public static void main(String[] args) {
int i = 0;
for (foo('A'); foo('B') && (i < 2); foo('C')) {
i++;
foo('D');
}
}
}
//没错的。
/*运行结果
A
B
D
C
B
D
C
B
*/
for(foo('A'); foo('B')&&(i<2); foo('C'))