//config.properties中配置了数据库配置的相关信息,通过这个单例模式设计来实现解耦。public class PathConfig { private static PathConfig instance = null; private String dataPath = null....
分类:
其他好文 时间:
2015-03-21 16:53:36
阅读次数:
95
喜欢手写学习,记忆深刻(字丑勿喷!)。计算过程的代码如下:public class PageRank{ private static double m[][]={ { 0 , 0.5 , 1 , 0 }, {0.333333333 , 0 , 0 , 0.5}, {0....
分类:
其他好文 时间:
2015-03-21 16:47:10
阅读次数:
185
public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Dispatcher.BeginInvoke(de...
分类:
其他好文 时间:
2015-03-21 15:29:30
阅读次数:
167
一、题目 如下为类型CMyString,请为该类型添加赋值运算符函数。 1 class CMyString 2 { 3 public: 4 CMyString(char* pData) 5 { 6 m_pData = new char[strlen(pData) +...
分类:
其他好文 时间:
2015-03-21 15:27:19
阅读次数:
132
创建类的对象:条用Class对象的newInstance方法 ????1.类必须有一个无参构造器 ????2.类的构造器的访问权限需要足够。 没有无参构造器也能创建: ????1.通过Class类的getDeclaredConstructor取得本类...
分类:
其他好文 时间:
2015-03-21 14:16:30
阅读次数:
85
JAVA类的生命周期,java类通过编译为.class文件,是字节码文件,然后放入虚拟机里面。
只有这种字节码文件才能够在java虚拟机中运行,java类的生命周期就是指一个class文件从加载到卸载的全过程。
(1)、关于JVM(java虚拟机):
· 方法区:在java的虚拟机中有一块专门用来存放已经加载的类信息、常量、静态变量以及方法代码的内存区域,叫做方法区。
· 常量池:常量...
分类:
其他好文 时间:
2015-03-21 14:08:00
阅读次数:
95
C++中的struct对C中的struct进行了扩充,它已经不再只是一个包含不同数据类型的数据结构了,它已经获取了太多的功能。struct能包含成员函数吗? 能!struct能继承吗? 能!!struct能实现多态吗? 能!!! 既然这些它都能实现,那它和class还能有什么区别? 最本质的一个区别...
分类:
编程语言 时间:
2015-03-21 13:59:40
阅读次数:
178
Implement pow(x,n).注意n等于INT_MIN的时候,直接让n = -n会整形溢出. 1 class Solution { 2 public: 3 double pow(double x, int n) { 4 if (n == 0) return 1; 5 ...
分类:
其他好文 时间:
2015-03-21 13:57:22
阅读次数:
130
1、通过在xml中配置,并且通过bean的存取方法进行注入。
2、bean类
package com.test.pro;
public class Singer {
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
...
分类:
编程语言 时间:
2015-03-21 12:42:00
阅读次数:
202
Implement atoi to convert a string to an integer.
具体的网上已经有很多解法
这里主要就是注意一些地方(最重要的就是返回值一开始最好赋值成为long long 因为有可能会越界)
然后就是一些特殊情况的分析了
class Solution {
public:
int atoi(string str) {
i...
分类:
其他好文 时间:
2015-03-21 12:40:46
阅读次数:
153