概念的介绍: 1.接口的定义 定义接口的关键字:interface 格式: public interface 接口名 extends 接口,... { //定义常量(常量名必须全部大写) public static final 数据类型 常量名 = 值; //定义抽象方法 public abstra ...
分类:
其他好文 时间:
2016-05-28 18:58:48
阅读次数:
247
public void saveUser(){ Session session=JdbcUtil.getSession(); User user=new User(); user.setName("zjf2"); user.setAddress("gzy2"); Transaction tx=ses ...
分类:
Web程序 时间:
2016-05-28 18:57:44
阅读次数:
182
BaseActivity/**所有Activity的基类*/public class BaseActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCrea... ...
分类:
其他好文 时间:
2016-05-28 18:57:37
阅读次数:
219
package exception; public class TestException { public static void main(String[] args) { try{ for(int i=0;i<4;i++) { int k; switch(i) { case 0: int ze ...
分类:
编程语言 时间:
2016-05-28 17:39:36
阅读次数:
245
题目描述 定义栈的数据结构,请在该类型中实现一个能够得到栈最小元素的min函数 解法一: 思路:采用java中自带的迭代函数进行处理。 public class Solution{ /** * @param args */ Stack<Integer> stack = new Stack<Integ ...
分类:
其他好文 时间:
2016-05-28 17:34:00
阅读次数:
224
1.新建LoadPropertis类,内容如下: import org.springframework.context.support.ClassPathXmlApplicationContext; import junit.framework.TestCase; public class Load ...
分类:
其他好文 时间:
2016-05-28 17:32:17
阅读次数:
178
import java.util.ArrayList; public class Bai { public static void main(String[] args) { ArrayList<Integer> a=new ArrayList<>(); for (int i = 0; i < 10 ...
分类:
其他好文 时间:
2016-05-28 17:27:40
阅读次数:
98
// this.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; class A { public: A() { i = 0; } void add() { i++;} A*sp() { return ... ...
分类:
其他好文 时间:
2016-05-28 17:26:43
阅读次数:
147
package exception; public class TestException { public static void main(String[] args) { for(int i=0;i<4;i++) { try { int k; switch(i) { case 0: int z ...
分类:
编程语言 时间:
2016-05-28 17:14:16
阅读次数:
234
public class helloworld{ public static void main(String[] args){ String s; s = "hello world!"; System.out.println("输出:"+s); } } 一个类中有且仅有一个主类,主类必须是stat ...
分类:
其他好文 时间:
2016-05-28 17:13:23
阅读次数:
181