java基础0615

1、

1)2)  

1)输出:Base  2)编译成功,但没有输出。

2、

编译成功,但没有输出。

3、

只有12行的话,不会新建文件。需要create~~

4、

public static void main(String[] args){
  String str = new String("abcde");
  str.replace('c', 'x');
  System.out.println(str);//输出的仍旧是原来的str
  String strNew = str.replace('c', 's');
  System.out.println(strNew);//输出的是修改后的字符串
}

5、

1) 2)

1)编译时报错:

Exception in thread "main" java.lang.ClassCastException: Base cannot be cast to subBase
at test0615.main(test0615.java:8)

 2)编译成功,但没有输出。

6、struts-config.xml配置文件中<forward>元素常用的属性是:name/path

7、<html:select>的子元素:<optgroup ></optgroup > <option></option>

8、java 类的修饰符:public、private(只能是内部类)、static、final、abstract

9、

1)构造器。

2)

输出:

test
done

Sysytem.gc();只是告诉JVM垃圾回收,但是至于JVM是否会回收是没办法控制的。

问题:程序输出done之前 t变量有没有被回收?

10.

输出:

here2
here3

纸上得来终觉浅,绝知此事要躬行
原文地址:https://www.cnblogs.com/yeyueyou/p/7019982.html