java" selection does not contain a main type"的问题处理方法
2012-12-28 16:39
507 查看
代码如下
package main;
public class Car {
int speed;
String color;
String name;
String direction;
public void drivecar()
{
speed=50;
direction="南方";
}
}
package main;
public class driverCar {
public static void main(String[] args)
{
Car mycar= new Car();
mycar.drivecar();
System.out.print("现在车速为:");
System.out.print(mycar.speed);
System.out.print("现在方向为:");
System.out.print(mycar.direction);
}
}
在作者初次运行本程序的时候,系统一直报错“selection does not contain a main type”,根据网上搜索到得原因改配置环境均不得理想效果,最后发现static关键字的疏忽,添加上程序运行OK。
package main;
public class Car {
int speed;
String color;
String name;
String direction;
public void drivecar()
{
speed=50;
direction="南方";
}
}
package main;
public class driverCar {
public static void main(String[] args)
{
Car mycar= new Car();
mycar.drivecar();
System.out.print("现在车速为:");
System.out.print(mycar.speed);
System.out.print("现在方向为:");
System.out.print(mycar.direction);
}
}
在作者初次运行本程序的时候,系统一直报错“selection does not contain a main type”,根据网上搜索到得原因改配置环境均不得理想效果,最后发现static关键字的疏忽,添加上程序运行OK。
相关文章推荐
- "editor does not contain a main type" 错误解决方法
- Eclipse环境开发java:Selection does not contain a main type
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- Eclipse报错 "Selection does not contain a main Type"
- eclipse中Editors does not contain a main type 图解处理方法
- editor does not contain a main type" 错误解决方法
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- editor does not contain a main type" 错误解决方法
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- Editor does not contain a main type 问题解决
- 【java】:selection doesn't contain a maintype
- eclipse解决editor does not contain a main type的方法
- selection does not contain a main type
- Exception in thread "main" java.lang.NoClassDefFoundError 问题及其解决方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- This parser does not support specification "null" version "null" 问题的处理 .
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法