2013-07-01 1 views
0

최근에 저는 일 년 전에 파스칼에서 저에게 쓴 프로그램을 기반으로 프로젝트를 진행하고 있습니다. 이 프로젝트에서 나는 그것을 자바로 만들고 앱으로 변형시켜야한다. 나는 변수를 선언하려 할 때 막혔다. 여기 내 파스칼 코드 :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; 

그리고 자바에서 이것을 시도하지만 만족하지 않는 것 :

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]; 

내가 직면 한 문제는 내가의 유형 선언에 어떤 아이디어가없는 것입니다 자바, 누구도 나에게 도움을 줄 수 있니? 고마워.

+0

시도한 내용은 무엇입니까? – Sieryuu

+0

변수가 보유한 데이터를보고 이에 따라 유형을 선택할 수 있습니다. – DevZer0

+0

나는 편집했고 내가 자바에서 한 것을 넣었다. plz가 보자. – SalFire012

답변

0

herehere 페이지를 살펴보면 몇 가지 차이점에 대해 설명합니다.

관련 문제