굿데이의 모든 사람들이, 유형은 배열 형식이어야하지만 "온도"-JAVA이
그래서 나는 온도를 만들 수있는 생성자가 클래스 온도를 제작하기로 결심. 온도는 2 개의 숫자 [냉기, 매운]의 arraylist입니다.public int hotness;
public int coldness;
public int[] temperature;
public int maxTemperature = 10000;
//Constructor Temperature
public Temperature(int hotness, int coldness) {
/**
* A constructor for the Array Temperature
*/
maxTemperature = getMaxTemperature();
if(hotness <= maxTemperature && coldness <= maxTemperature)
temperature[0] = coldness;
temperature[1] = hotness;
}
이제 다른 클래스로 가서 해당 개체 온도를 사용하여 계산을 수행하고 싶습니다. 여기에 대한 코드가 있습니다. 식의 종류가 배열 유형이어야하지만 "온도"
어떤 솔루션에 해결 :
//Variabels
public int volatility;
private static Temperature temperature;
private static int intrensicExplosivity;
public static int standardVolatility(){
if(temperature[0] == 0){
int standardVolatility = 100 * intrensicExplosivity * (0.10 * temperature[1]);
}
그래서 지금은 오류가?
저는 Java에 대해 처음이에요. 그래서 아마도 synthax 에러 일 겁니다.하지만 찾을 수는 없습니다.
미리 감사드립니다. 대신
public static int standardVolatility() {
if(temperature[0] == 0) {
의 데이비드
와 객체를 초기화하기 잊지 마세요 예외 또는 오류하시기 바랍니다의 스택 추적을 게시하시기 바랍니다. – Crazenezz