1. 最简单的情形 public void main(){ String s =
test(); System.out.println("s=[" + s + "]"); } public String test(){ String...
分类:
编程语言 时间:
2014-05-26 06:43:27
阅读次数:
194
今天在研究微信公众平台 自动接收发送消息的时候,在如下代码: public String
processRequest(HttpServletRequest request) { String respMessage = null; try {
System.err.println(inputStr...
分类:
微信 时间:
2014-05-25 23:47:40
阅读次数:
705
Am.java中: View Code@Override public void onRun()
throws Exception { mAm = ActivityManagerNative.getDefault(); if (mAm == null) {
System.err.println(NO...
分类:
其他好文 时间:
2014-05-25 12:20:45
阅读次数:
391
假定web application 名称为news,你在浏览器中输入请求路径:
http://localhost:8080/news/main/list.jsp 则执行下面向行代码后打印出如下结果:1、
System.out.println(request.getContextPath()); 打印...
分类:
其他好文 时间:
2014-05-24 08:05:54
阅读次数:
264
二十一、提交java代码前应该检查是否有没用的语句,如:System.out.println(); jsp页面上面是否有alert调试信息 不规范示例:暂无
规范实例:暂无 解析:因为如果保留了有可能会影响到程序正常运行的结果,如: for(int i=0;i<10;i++){ Sy...
分类:
编程语言 时间:
2014-05-23 09:44:57
阅读次数:
233
class SuperClass{ static{ System.out.println("super
class init!"); } static int superInt = 1; static String superString = "supS...
分类:
编程语言 时间:
2014-05-23 04:35:31
阅读次数:
253
先来看一段代码: public static void main(String[] args) {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.out.println("阳光小强");
}
}, 5000);
int i = 0;
wh...
分类:
移动开发 时间:
2014-05-21 16:56:51
阅读次数:
296
public class setZero {
static void print(int [][]a){
for(int i=0;i<a.length;i++){
for(int j=0;j<a[i].length;j++){
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
/*stati...
分类:
其他好文 时间:
2014-05-21 16:16:56
阅读次数:
252
String在java中算是一个比较特殊的类,既能作为基本数据类型使用(Stringstr="123"),也能作为对象使用(Stringstr=newString("123"))。我们先看几组简单的测试。第一组:Stringstr1=newString("123");
Stringstr2=newString("123");
System.out.println(str1==str2);//false
S..
分类:
其他好文 时间:
2014-05-21 02:38:05
阅读次数:
277
publicnativeStringintern();这个是在String类源码中申明的一个方法,是一个本地方法,返回的是一个String对象的引用。先看一下代码:Strings1="123";
Strings2=newString("123");
System.out.println(s1==s2);//false
System.out.println(s1==s2.intern());//trues1==s2结果为..
分类:
其他好文 时间:
2014-05-20 18:08:41
阅读次数:
286