나는 얼마 동안 배열을 가지고 놀았으며이 문제는 나를 괴롭혔다.배열의 객체 초기화
나는 사용자 정의 된 객체를 생성하고 다음과 같은 배열로 선언했다 :`Property regesteredAssets [] = new Property [200];
그리고 여기 내 생성자의`
public Property(String newPropertyName,String newPropertyAddress,String newPropertyType, String newPropertyDescription)
{
propertyName[arraySequence] = newPropertyName;
propertyFullAddress[arraySequence] = newPropertyAddress;
propertyType[arraySequence] = newPropertyType;
propertyDescription[arraySequence] = newPropertyDescription;
arraySequence++;
}
내가 내 욕망에 따라 각 배열
regesteredAsssets[]
을 초기화 할 수 있습니다. 내가 어떻게 해?
Property
클래스의 속성에도 배열을 사용해야합니까?
의미는 있지만 유형을 선언하지 않는 것이 좋습니다. 'Property [] registeredAssets;와는 반대로,''PropertyAssets [];' '와는 반대이다. 배열 및 단일 객체를 선 아래로 쉽게 배치 할 수 있습니다. – indivisible