public class jia { public static void main(String[] args) { // TODO 自动生成的方法存根 double jiecheng=1; double sum=0; int j=0; for(int i=1;i<20;i++) { do { j ...
分类:
其他好文 时间:
2016-05-09 15:49:31
阅读次数:
283
public class Test9_1 implements Runnable{ int count; static Object obj = new Object(); public void run() { synchronized(obj){ if(Thread.currentThread( ...
分类:
编程语言 时间:
2016-05-09 15:48:39
阅读次数:
212
投票 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3 ...
分类:
Web程序 时间:
2016-05-09 15:48:24
阅读次数:
156
package com.hanqi; public class jiecheng { public static void main(String[] args) { // TODO 自动生成的方法存根 int i=0; int jiecheng=1; do { i++; jiecheng=jiec ...
分类:
其他好文 时间:
2016-05-09 15:45:24
阅读次数:
357
使用SpringMvc的@ResponseBody返回指定数据的类型做为http体向外输出,在浏览器里返回的内容里有中文,会出现乱码,项目的编码、tomcat编码等都已设置成utf-8,如下返回的是一个字符串中文乱码。Java代码@RequestMapping("user/get_comment_list.do")public@ResponseBodyString..
分类:
编程语言 时间:
2016-05-09 14:33:09
阅读次数:
379
一般我们变成很少使用到 intern这个方法,今天我就来解释一下这个方法是干什么的,做什么用的 首先请大家看一个例子: [java] view plain copy print? public static void main(String[] args) throws Exception { St ...
分类:
编程语言 时间:
2016-05-09 14:09:25
阅读次数:
195
import java.util.Scanner; public class q1168 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String shtstr = scan ...
分类:
其他好文 时间:
2016-05-09 14:06:29
阅读次数:
157
package fileTest; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; public class ConnTest { public static void main(String arg ...
分类:
Web程序 时间:
2016-05-09 14:03:11
阅读次数:
581
1.采用数据库悲观锁来实现同步 2.Redis实现分布式锁 /** * @author http://blog.csdn.net/java2000_wl * @version <b>1.0.0</b> */public class RedisBillLockHandler implements IB ...
分类:
其他好文 时间:
2016-05-09 14:01:57
阅读次数:
178
解一: public class ModelConvertHelper<T> where T : new() // 此处一定要加上new() { public static IList<T> ConvertToModel(DataTable dt) { IList<T> ts = new List< ...
分类:
其他好文 时间:
2016-05-09 12:47:06
阅读次数:
143