public class Test
{
public static void main(String[] args)
{
System.out.println("Hello World!");
String s = new String();
s = "abcd";
System.out.println(s.count);
}
}查看String类的源代码发现count是String的私有变量
/** The count is the number of characters in the String. */
private final int count;
那为什么在编译的时候System.out.println(s.count);这里编译不过去?
请指教?
{
public static void main(String[] args)
{
System.out.println("Hello World!");
String s = new String();
s = "abcd";
System.out.println(s.count);
}
}查看String类的源代码发现count是String的私有变量
/** The count is the number of characters in the String. */
private final int count;
那为什么在编译的时候System.out.println(s.count);这里编译不过去?
请指教?
解决方案 »
- java初学用什么编辑器好
- DefaultTreeModel与DefaultMutableTreeNode的区别?
- socket编程
- 一个简单的问题 请看
- 小弟有一道习题,实在不行了,我只能编出框架来,调用接口监听和文件存取时总是出错,不知道为什么? 哪位好心的大哥给编一下,小弟这里谢过
- 请问从文件读取与从数据库读取哪个消耗资源大
- com.ms.activeX.ActiveXComponent类哪里找得到啊?
- 有谁知道如何做一个html文件中的tree,就像www.helpwork.com那样的。在线等待,问题解决一定送高分!!!
- 我要生成java 的文档在dos 下用什么命令.
- 为什麽会出现java.io.IOException: Connection reset by peer的错误
- 这个问题求人帮忙 谢谢
- 高分请教:如何在JTable中创建JTree
加油。