JAVA Problem

来源:百度知道 编辑:UC知道 时间:2024/05/12 01:46:57
Write a Java program named MP1.java that performs according to the following specifications:

(1) (20 marks)
The command line of your program accepts 1 or more arguments. When there is only 1 argument, MP1 interprets the argument as a file name in the current directory. In this case, MP1 prints out the contents of the file. If the file does not exist, MP1 reports an error message and exit. The syntax looks like:

$java MP1 file1

(Note: your program should contain logic to read data from the file and print out the data. Calling the Linux command “cat file1” from your program will be unacceptable.)

For illustration purpose below, assume that the contents of file1 are:

Java is programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform.
The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level f

有点长,分3部分发给你了,站内信里,自己check下吧。

public class LCContPlanUI
{
/** 错误处理类,每个需要错误处理的类中都放置该类 */
public CErrors mErrors = new CErrors();
private VData mResult = new VData();

/** 往后面传输数据的容器 */
private VData mInputData = new VData();

/** 数据操作字符串 */
private String mOperate;

/** 全局数据 */
private GlobalInput mGlobalInput = new GlobalInput();
private LCContPlanDutyParamSet mLCContPlanDutyParamSet = new
LCContPlanDutyParamSet();
private LCContPlanSchema mLCContPlanSchema = new
LCContPlanSchema();
// private String mGrpContNo = "";
// private String mContPlanCode = "";
// private String mProposalGrpContNo = "";
// private String mPlanSql = "";
// private String mPlanType = "";
// private String mPeoples3 = &qu