如何在Java中声明Pascal的类型?

时间:2013-07-01 07:07:25

标签: android types pascal declare

最近,我根据一年前在Pascal写的一个程序来处理我的项目。在这个项目中,我必须将它转换为java并将其转换为应用程序。当我试图声明变量时,我陷入了困境。这是我的Pascal代码:

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中声明类型没有任何想法,有人能给我一些帮助吗?非常感谢。

1 个答案:

答案 0 :(得分:0)

查看这些页面herehere,它解释了一些差异。