1.抛出异常:throw 异常对象;下面的代码是一个进制转换代码,可以转换为2进制和8进制,如果输入其他参数,则抛出异常。 1 public static String transform(int value,int radix){ 2 if(value <0 ) 3 ...
分类:
其他好文 时间:
2015-03-06 23:32:49
阅读次数:
151
未整理完..#include#include#include#includeusing namespace std;struct PostfixExpre { string infix; PostfixExpre(string _infix) { infix = _infi...
分类:
其他好文 时间:
2015-03-06 23:30:27
阅读次数:
176
首先要知道委托是什么,委托实际上就相当于C语言中的函数指针一 声明委托示例:delegate void StringProcessor(string input);这是一个返回值为空的委托声明,其中声明的参数必须是string 类型,同时比较写出返回类型(这个类型必须与委托指向的方法的返回值的类型一...
分类:
其他好文 时间:
2015-03-06 23:27:48
阅读次数:
169
/** * 运行shell脚本 * @param shell 需要运行的shell脚本 */ public static void execShell(String shell){ try { Runtime rt = Runtime.getRuntime(); rt.exec(sh...
分类:
编程语言 时间:
2015-03-06 23:24:47
阅读次数:
218
从现实入手
我早上起床,光着身子。这时我要穿衣服,先穿裤子再穿上衣。
我该怎么实现这个过程呢?
首先我是一个赤裸裸的人,并且我能被别人看到:class Person {
protected String name;
protected String body;
public void show(){
System.out.println("身体");...
分类:
其他好文 时间:
2015-03-06 22:17:32
阅读次数:
188
1 package com.java.sizeyunsuan; 2 3 public class lianxi { 4 String f() 5 { 6 int i=(int)(Math.random()*10); 7 int j=(int)(Ma...
分类:
编程语言 时间:
2015-03-06 22:11:15
阅读次数:
293
方法:1. 基本的main方法:public static void main(String[] args)2.静态方法内部调用非静态方法:重新声明一个类,通过这个类来调用非静态方法 1 public class MAINMETHOD { 2 public static void main(...
分类:
其他好文 时间:
2015-03-06 22:09:29
阅读次数:
208
打闹钟时间编程 DateTime dt = new DateTime(); dt = DateTime.Now; string t = "2015-3-6 10:00"; DateTime x = Convert.ToDateTime(t); while (true) { if (dt>...
分类:
其他好文 时间:
2015-03-06 22:06:04
阅读次数:
139
#创建表人信息表person(String name,int age)hive> create table person(name STRING,age INT)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' ESCAPED BY '\\' STORED...
分类:
其他好文 时间:
2015-03-06 22:02:49
阅读次数:
11717
1.字符指针的初始化 在c语言中 "string"保存的就是首个字符所在的地址 所以可以把 字符串常量"string" 赋值给指针 char *p; char *s ="123456"; p="string" 但不能把字符串常量直接赋给数组,
char ch1[10];
ch1="123456";
...
分类:
编程语言 时间:
2015-03-06 21:59:42
阅读次数:
206