运行JAVA The selection does not contain a main ty
运行JAVA The selection does not contain a main typ运行JAVA The selection does not contain a main type用Eclipse 新建一个工程后,在工程下建了一个Example 类 package examplepack; /*用户自定义包*/ import .*; /*类库装载*/ interface DealInt{ /*声明一个接口*/ public abstract void dealInt(); } /*接口声明结束*/ class ANumber implements DealInt{ /*声明一个类,实现接口*/ int i=4; public void dealInt() /*实现接口中的方法*/ { intln(i); } } /*类ANumber结束*/ public class Example { /*声明一个主类*/ public static void main(String[] args) /*主类的main方法*/ { ANumber n1=new ANumber(); alInt(); /*调用方法*/ n1.i=123; intln("n1.i="+n1.i); try{ rrentThread().sleep(5*1000); }catch(InterruptedException e){} } /*main方法结束*/ } /*类Example结束*/ 为什么运行时会"The selection does not contain a main type."代码是没有错误的啊.
出现这个问题,是因为.java文件不在项目的src路径内,也就是说源代码未被eclipse编译,字节码不存在无法运行了 在项目名上右键 -> Builder Path -> Configure Build Path -> 选择Source面板,再点Add Folder, 把源代码所在的包路径的上层目录加进来.
答:可以肯定的说,出现的两个问题不是tomcat的问题,也不是eclipse的问题 那是因为你没有将你的web的配置好造成的 第一个问题一找不到你要访问的文件,也就...详情>>
答:google "java 缓冲池"详情>>
答:百度里搜张孝祥 非常好的视频教程详情>>