1.定义Student类packagecn;
importorg.springframework.stereotype.Component;
/**
*Student类
*@authorAdministrator
*
*/
@Component
publicclassStudent{
/**
*定义学生说话的方法
*/
publicvoidsay(){
System.out.println("学生说话");
}
}2.定义Person类packagecn;
/**..
分类:
其他好文 时间:
2016-07-11 10:41:52
阅读次数:
541
默认情况下tomcat6.0.26日志存放路径为tomcat6.0.26/logs下:[root@modelC65tomcat6.0.26]#cdlogs/[root@modelC65logs]#lltotal0-rw-r--r--.1rootroot0Jul1010:35catalina.2016-07-10.log-rw-r--r--.1rootroot0Jul1010:35catalina.out-rw-r--r--.1rootroot0Jul1010:35host-manag..
分类:
其他好文 时间:
2016-07-11 01:27:02
阅读次数:
159
public class A { public int number = 5; { number = 10; } public static void main(String[] args) { A a = new A(); System.out.println(a.number); }} 这段代码 ...
分类:
其他好文 时间:
2016-07-11 00:58:23
阅读次数:
117
I/O系统 输入流InputStream File file = new File("E:\\ello"); //找到指定文件 if(file.exists()){//文件是否存在 System.out.println("存在"); }else{ System.out.println("不存在"); ...
分类:
其他好文 时间:
2016-07-10 23:10:32
阅读次数:
183
class Person{ String name="小花"; int age=19; void eat(){ System.out.println("在吃饭"); }}class Student extends Person{ void study(String name,int age){ Sy ...
分类:
其他好文 时间:
2016-07-10 21:43:16
阅读次数:
174
Integer a = new Integer(123); Integer b = new Integer(123); System.out.println(a == b); System.out.println(a.equals(b)); System.out.println(a.equals(1 ...
分类:
编程语言 时间:
2016-07-10 21:23:57
阅读次数:
223
JSP的第一个对象为out对象 为向客户端输出信息
//out表示向客户端输出各种数据
//对输出缓冲区进行管理 可以通过page属性来改变缓冲区
out.println("操");
out.print("cao");
out.newLine();
out.println("");
out.print("cao");
刷新缓冲区 可以用
//强制刷新缓冲区的数据
out.flush();...
分类:
Web程序 时间:
2016-07-10 19:06:39
阅读次数:
327
字符串
new String(“abc”)创建了几个对象?
一个或两个,如果常量池中原来有“abc”,则只创建一个对象;如果常量池中原来没有字符串“abc”,那么就会创建两个对象。
String s="abc";
String s1="ab"+"c";
System.out.println(s==s1);
输出 true ,因为"ab"+"c"在编译器就被转换为"abc",存放在常量区,...
分类:
编程语言 时间:
2016-07-10 19:00:23
阅读次数:
203
/*需求:简单的卖票程序多个窗口买票*/class Ticket extends Thread{ private static int tick=100; public void run() { while(true) { if(tick>0) { System.out.println(Thread ...
分类:
编程语言 时间:
2016-07-10 18:07:46
阅读次数:
139
今天有个人在QQ上问我,说Java使用System.out.print('a');打印正确,但是System.out.print('a'+'b');打印195,是什么情况? 就此我给出以下解释分享给大家,以免以后大家遇到如此问题时手足无措。 问题在于单引号,单引号里的是一个字符,也就是char类型, ...
分类:
其他好文 时间:
2016-07-10 15:16:29
阅读次数:
128