一些练习题 //第一题: //让学生输入其姓名和语文,数学,英语,编程求总分和平均分 //并在屏幕上显示:XX你的总分分数为XX分,平均为XX分。 try { ...
分类:
其他好文 时间:
2014-07-09 23:06:02
阅读次数:
252
《OOC》全名是《Object-oriented Programming with ANSI-C》,步步为营地讲述了作者用C来实现封装、继承、多态、异常处理和自动化工具的过程。这本书吸引我的理由如下: 我也研究过OOC的问题,想和作者对比对比,取长补短。 学习C实现异常处理try{}ca...
分类:
其他好文 时间:
2014-07-09 20:51:09
阅读次数:
197
try { psv.SetPlotConfigurationName(ps, cOre, null); } catch (SystemException ex) { ed.WriteMessage("\n错误行开始:"); ed.WriteMessage("\n错误状态:" + ex.InnerEx...
分类:
其他好文 时间:
2014-07-09 13:59:42
阅读次数:
128
try-catch语句只要代码中包含finally子句,则无论try或catch语句块中包含什么代码--甚至return语句,都不会阻止finally子句的执行,来看下面这个函数: function testFinally(){ try{ return 2; }catch(error...
分类:
编程语言 时间:
2014-07-08 23:26:00
阅读次数:
249
//得到目录下的所有文件夹public static void Get_All_Filepath_In_Directory(string dirpath, List listpaths) { List filePaths = listpaths; //存放文件的路径 try { if (Is_Dir...
分类:
其他好文 时间:
2014-07-08 23:24:07
阅读次数:
183
public class MResource {
public static int getIdByName(Context context, String className, String name) {
String packageName = context.getPackageName();
Class r = null;
int id = 0;
try {
r...
分类:
其他好文 时间:
2014-07-08 20:49:55
阅读次数:
189
foreach
(PHP 4, PHP 5)
The foreach construct provides an easy way to iterate over arrays. foreach works only on arrays and objects, and will issue an error when you try to use it on a variable w...
分类:
Web程序 时间:
2014-07-08 19:52:38
阅读次数:
291
publicstaticvoidmain(Stringargs[]){
System.out.println(321);
PreparedStatementps=null;
ResultSetrs=null;
Connectionct=null;
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Stringurl="jdbc:microsoft:sqlserver://serverxp.com:1433;Database..
分类:
数据库 时间:
2014-07-08 12:02:24
阅读次数:
270
以基本的学生选课为例,建立选课数据库,学生、班级、选课信息三张表,并分别对表进行插删改操作:importMySQLdb
try:
conn=MySQLdb.connect(host=‘localhost‘,user=‘root‘,passwd=‘root‘,db=‘xuanke‘,port=3306)
cur=conn.cursor()
cur.execute("CREATEDATABASExuanke")
..
分类:
数据库 时间:
2014-07-08 08:05:43
阅读次数:
479
@SuppressWarnings("rawtypes")
public static void getProperties() {
Properties properties = null;
InputStream in = null;
try {
properties = new Properties();
//获取文件
in = Object.cla...
分类:
编程语言 时间:
2014-07-05 23:47:03
阅读次数:
290