码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
不可变String及可变StringBuilder
String和StringBuilder、StringBuffer的小总结 一、不可变String 先查看JDK文档看下String public final class String extends Object implements Serializable, Comparable, CharSequence String是final类型,意味着它是不可改变的,然而每次对S...
分类:其他好文   时间:2015-04-28 18:38:59    阅读次数:106
JDK的动态代理为什么必须要使用接口与使用CGLIB动态代理
一.JDK的动态代理为什么必须要使用接口 JDK的代理Proxy必须要使用接口,才可以实现对方法的拦截。为什么呢?先让我们看一个JDK动态代理的示例: 接口类: public interface IPerson {     public void sayHi(String nm); } 接口实现类: public class Person  implements IPer...
分类:其他好文   时间:2015-04-28 18:36:27    阅读次数:185
leetcode ||131、Palindrome Partitioning
problem: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Retur...
分类:其他好文   时间:2015-04-28 18:27:59    阅读次数:104
java 加权随机数实现
import java.util.HashMap; import java.util.Map; import java.util.Random; public class Test1 {     // String 可以为任意类型 也可以自定义类型     static Map keyChanceMap = new HashMap();     static { //    ...
分类:编程语言   时间:2015-04-28 18:23:50    阅读次数:150
hibernate 数据关联一对一 3.2
第一种一对一person和card,card的id即作为主键,又作为外键// 各村对方的一个对象 public class Person { private Integer id; private String name; private Card card;}public cla...
分类:Web程序   时间:2015-04-28 18:14:55    阅读次数:151
Java 泛型
一. 泛型概念的提出(为什么需要泛型)?首先,我们看下下面这段简短的代码: 1 public class GenericTest { 2 3 public static void main(String[] args) { 4 List list = new Ar...
分类:编程语言   时间:2015-04-28 18:13:15    阅读次数:251
C# 截取字符串
1.根据单个分隔字符用split截取例如string st="GT123_1";string[] sArray=st.split("_");即可得到sArray[0]="GT123",sArray[1]="1";2.利用多个字符来分隔字符串例如string str = "GTAZB_JiangjBe...
分类:Windows程序   时间:2015-04-28 18:09:54    阅读次数:142
Mybatis foreach嵌套遍历Map的key和value
最近做东西,需要向数据库存储一个保存在HashMap的key和value中的数据。具体的结构大致是Map>。数据库中需要保存两个个字段:1.key中对象的id,set中的多个string,显然id和set中的string是1对多的关系;需要嵌套循环。一开始怀疑Mybatis能否做到这样灵活sql.....
分类:其他好文   时间:2015-04-28 18:02:24    阅读次数:411
ajax 回传参数
JSONObject json = new JSONObject(); json.put("msg", msg); json.put("success", count); json.put("error", count2); String jsonString=js...
分类:Web程序   时间:2015-04-28 17:55:48    阅读次数:153
AJAX方式调用百度天气
后台代码: [HttpPost] public string AjaxWeather() { string CityName = string.IsNullOrEmpty(Request.Form["city"]) ? "" : Req...
分类:Web程序   时间:2015-04-28 17:53:28    阅读次数:233
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!