![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
哈哈哈·
这个作者很懒,什么都没留下…
展开
-
java 基础 内部类的实例化
内部类不能通过: 类名 对象=new类名();来实现。例: public class Test { public static void main(String[] args) { } class Demo{ public void say(){ System.out.println("我是一个内部类"); } } } ...原创 2015-09-09 14:46:25 · 103 阅读 · 0 评论 -
利用字符流把文件内容输出到控制台
try{ File fin=new File("hello.java"); BufferedReader in = new BufferedReader(new FileReader(fin)); String s; while((s = in.readLine(...原创 2015-09-16 14:05:22 · 656 阅读 · 0 评论 -
转义字符的使用
例如转义引号可以这样:String str = " \" "; System.out.println(str); 输出结果为 “ 即 \" 就转义成了字符串的引号原创 2016-09-22 16:33:12 · 113 阅读 · 0 评论 -
解决Debug JDK source 无法查看局部变量的问题方案
一.问题阐述 首先我们要明白JDK source为什么在debug的时候无法观察局部变量,因为在jdk中,sun对rt.jar中的类编译时,去除了调试信息,这样在eclipse中就不能看到局部变量的值。这样的话,如果在debug的时候查看局部变量,就必须自己编译相应的源码使之拥有调试信息。要达到这个目的,一是找网上人家已经编译好的版本,剩下的只能自己去编译。下面我们对于自己编译提供一个方法,...原创 2016-11-02 15:14:40 · 118 阅读 · 0 评论 -
public,protected ,friendly ,private 的作用范围
作用域 当前类 同一package 子孙类 其他package public √ √ √ √ protected √ √ √ × f...原创 2017-04-13 17:58:52 · 99 阅读 · 0 评论 -
String 写入文件
public static void main(String[] args){ String str = "thisis test "; File file = new File("d:/"); FileOutputStream fileoutput = new FileOutputStream(file+"text.text",false); Writer writer = new ...原创 2016-12-09 16:30:04 · 389 阅读 · 0 评论