首先了解字符串常量池的设计思想: 字符串的分配和其他的对象分配一样,需要耗费高昂的时间与空间代价,作为最基础的数据类型,大量频繁的创建字符串会极大程度地影响程序的性能。JVM为了提高性能和减少内存开销,在实例化字符串常量的时候进行了一些优化: 1)为字符串开辟一个字符串常量池,类似于缓存区。 2)创 ...
分类:
其他好文 时间:
2020-12-01 12:39:01
阅读次数:
8
Request对象的主要方法有哪些? 方法 解释 setAttribute(String name,Object) 设置名字为name的request 的参数值 getAttribute(String name) 返回由name指定的属性值 getAttributeNames() 返回request ...
分类:
Web程序 时间:
2020-12-01 12:25:03
阅读次数:
8
#include<iostream> #include<string> using namespace std; void getNext(string s, int *nex) { nex[0] = -1; int i = 0, j = -1; int len = s.length(); whil ...
分类:
其他好文 时间:
2020-12-01 12:22:41
阅读次数:
7
filters:{ dotime(mess){ if(mess&&mess.length>10){ return mess.substring(5,10) } }, do2time(mess){ if(mess&&mess.length>10){ return mess.substring(11,1 ...
分类:
其他好文 时间:
2020-12-01 12:22:25
阅读次数:
11
#include<iostream> #include<cstring> using namespace std; int len; void getNext(char *s, int *nex) { nex[0] = -1; int i = 0, j = -1; while(i < len) { ...
分类:
其他好文 时间:
2020-12-01 12:21:17
阅读次数:
7
C#中,判断相等有两种方式,一种是传统的==操作,一种是object提供的Equals方法。二者的区别在于: 一、==操作符判断的是堆栈中的值,Equlas判断的是堆中的值。 C#提供值类型和引用类型,值类型存储在栈上,故用==判断是直接判断其值是否相等,因为值类型不存在堆中的数据,因此值类型的Eq ...
分类:
其他好文 时间:
2020-12-01 12:02:02
阅读次数:
2
//加载插件 private void LoadPlugins() { string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "addons"); //搜索该目录下的所有 ...
L2-1 功夫传人 (25分) 假算法过题 #include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<cstring> #include<string> #include<map> #inclu ...
分类:
其他好文 时间:
2020-12-01 11:50:35
阅读次数:
3
#题目链接 increasing-decreasing-string #题目内容 给你一个字符串 s ,请你根据下面的算法重新构造字符串: 从 s 中选出 最小 的字符,将它 接在 结果字符串的后面。 从 s 剩余字符中选出 最小 的字符,且该字符比上一个添加的字符大,将它 接在 结果字符串后面。 ...
分类:
其他好文 时间:
2020-12-01 11:47:42
阅读次数:
3
final关键字代表最终的,不可改变的 常见的四种用法 修饰类 当final修饰一个类的时候 格式: public final class 类名名{ //。。。 //。。。 } //被final修饰的类代表这个类不能被其它类继承。(方法不能被重写)(这个类依然拥有父类) //比如:String类、S ...
分类:
其他好文 时间:
2020-11-30 16:16:17
阅读次数:
11