我是Java初学者,我想问一个问题 包 stringvars 在Java中是什么意思?
package stringvars;
import java.util.Scanner;
public class myProg{
public static void main(String[] args)
{
Scanner user_input = new Scanner(System.in);
String first_name; //packge stringvars
System.out.print("Kindly Enter your first name: ");
first_name = user_input.next();
String family_name; //packge stringvars
System.out.print("Enter your family name: ");
family_name = user_input.next();
String full_name; //packge stringvars
full_name = first_name + " " + family_name;
System.out.println("I Guess you are " + full_name);
}
}
并且当我尝试运行Java时也出现错误
答案 0 :(得分:0)
由于您将软件包声明为
package stringvars;
您的Java类应位于 stringvars 文件夹中。比您可以尝试编译和运行。