public class Assignment1 {
public static void main(String[] args)
{
String e1 = "apple"; String e2 = "mango";
String e3 = "banana"; String e4 = "cherry"; String fruit;
int num = 1;
while (num <= 4){
fruit = "e" + num;
System.out.println(fruit);
count++;
}
}
}
我制作了我将要做的示例代码,我希望代码结果将输出为
apple
mango
banana
cherry
但我得到的是:
e1
e2
e3
e4
你能帮我把连接的字符串识别为我应该声明的字符串变量吗?