Recently I'm working on my project based on a program written by me in Pascal a year before. In this project I have to make it in to java and transform it to an app. I got stuck when I tried to declare variables. Here is my Pascal code:
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;
And I tried this in Java but it doesn't seem satisfying:
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];
The problem I faced is I don't have any ideas in declaring types in Java, can anyone provide me some help? Thanks a lot.