0

最近,我正在根据我一年前用 Pascal 编写的程序来开发我的项目。在这个项目中,我必须将其转换为 java 并将其转换为应用程序。当我尝试声明变量时,我被卡住了。这是我的帕斯卡代码:

const choiceno=15;
  maxword=1500;
  maxlen=20;

type stringtype = string[maxlen];
     wordtype = record
              words:stringtype;
              no:integer
            end;

var  diskfile,savetxt:text;
     style,aparno,eparno,wordno,wordpt,punno,choice,code,error:integer;
     strg:string[3];
     path:string;
     sensitive:boolean;
     wordct:array[1..maxword] of wordtype;
     letterno:array[97..122] of integer;
     capletno:array[65..90] of integer;

我在 Java 中尝试过,但似乎并不令人满意:

public final int ChoiceNo = 15;
public final int MaxWord = 1500;
public final int MaxLength = 20;
public String string ;
public int record;
public String Words;
public int No;
public String DiskFile;
public String Savetxt;
public int Style;
public int AparNo;
public int EparNo;
public int WordNo;
public int Wordpt;
public int PunNo;
public int Choice;
public int Code;
public int Error;
public String strg;
public String path;
public boolean Sensitive;
String[] WordCt = new String[MaxWord];
int[] LetterNo = new int[26];

我面临的问题是我对在 Java 中声明类型没有任何想法,谁能给我一些帮助?非常感谢。

4

1 回答 1

0

Take a look at these pages here and here, it explains some differences.

于 2013-07-01T07:29:37.440 回答