selection does not contain a main type的问题
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/12 20:45:01
selection does not contain a main type的问题
import java.util.Scanner;
public class Population {
private String name;
private int population;
private double growthRate;
public void readInput()
{
Scanner keyboard = new Scanner(System.in);
System.out.println("what is the species' name ");
name = keyboard.nextLine();
System.out.print("what is the popution of lll");
population = keyboard.nextInt();
while (population < 0);
{
System.out.println("population can not be negatived");
System.out.print("Reenter population:");
population = keyboard.nextInt();
}
System.out.println("Enter growth rate:");
growthRate = keyboard.nextDouble();
}
public void writeOutput()
{
System.out.println("Name = " + name);
System.out.println("Population = " + population);
System.out.println("Goth rate = " + growthRate + "%");
}
}
Java文件也在src下面,为什么就是不能运行呢?写的其他程序就能,怎么解决啊,不要找什么更改目录的回答了
import java.util.Scanner;
public class Population {
private String name;
private int population;
private double growthRate;
public void readInput()
{
Scanner keyboard = new Scanner(System.in);
System.out.println("what is the species' name ");
name = keyboard.nextLine();
System.out.print("what is the popution of lll");
population = keyboard.nextInt();
while (population < 0);
{
System.out.println("population can not be negatived");
System.out.print("Reenter population:");
population = keyboard.nextInt();
}
System.out.println("Enter growth rate:");
growthRate = keyboard.nextDouble();
}
public void writeOutput()
{
System.out.println("Name = " + name);
System.out.println("Population = " + population);
System.out.println("Goth rate = " + growthRate + "%");
}
}
Java文件也在src下面,为什么就是不能运行呢?写的其他程序就能,怎么解决啊,不要找什么更改目录的回答了
没有静态的main(String args[])方法,程序无法直接启动!
public static void main(String args[]){
Population p = new Population ();
p.readInput();
p.writeOutput();
}
以上代码加入到类里面;
public static void main(String args[]){
Population p = new Population ();
p.readInput();
p.writeOutput();
}
以上代码加入到类里面;
editor does not contain a main type求助
does not contain polysorbate80是什么意思?
This selection does not support run mode
这句话什么意思 ?If a question does not contain a vocabulary word .
DSP5509烧写问题:提示 Does not match the target type.not loaded
The specifide folder does not contain the correct volume
The password does not contain the required characters是什么意思
the operating system image you selected does not contain the
a wide selection of的意思
my eclipse中出现The selection does not support run mode
what does a diet of healthy foods contain
How many electrons does a neurtral fluorine atom contain?