println

    1熱度

    2回答

    我想不通,爲什麼我的代碼是造成的PrintStream去一個新行: // displays the total time of the leak in months from the calculateLeakTime() method. String leakTime = LeakCalculator.calculateLeakTime(); System.out.print

    0熱度

    1回答

    我想填充一個值爲-1的java中的7x6空白2d數組。 int[][] anArray = new int[7][6]; 然後創建了一個方法setArray(),其看起來如下: 我通過鍵入初始化在非主類陣列 public int[][] setArray() { for (int i = 0; i < 7; i++) { for (int j = 0;

    6熱度

    1回答

    //take the input from user text = br.readLine(); //convert to char array char ary[] = text.toCharArray(); System.out.println("initial string is:" + text.toCharArray()); System.out.println(tex

    -4熱度

    2回答

    說我有配發的代碼如.. " System.out.println("This is code"); System.out.println("This is code"); System.out.println("This is code"); System.out.println("This is code"); " 此相同的代碼來不斷在我的節

    0熱度

    1回答

    if(a >= b && a >= c && b >= c) { System.out.println(a + b + c); } else if(a >= b && a >= c && c >= b) { System.out.println(a + c + b); } else if(b >= a && b >= c && a

    0熱度

    8回答

    當我運行這段代碼,它打印0,1,2,但我不知道爲什麼。你能解釋我嗎? public void run() { int[] arr = new int [3]; for(int i=0; i<arr.length;i++){ arr[i]=i; } domore(arr); for(int i=0; i<arr.length;

    0熱度

    1回答

    將我們的ArrayList寫入文件時出現問題。 該文件保持空白。我們在代碼中找不到任何錯誤。 請幫助我們,我們的截止日期是在幾個小時內... public void rapportAssortiment(String winkelNaam) throws Exception { ArrayList <Artikel> assortiment = db.rapportAssor

    0熱度

    3回答

    我嘗試打印字符串時遇到問題。我希望整個println閱讀這樣的「BAR,ORANGE和PLUM」。這些字符串似乎沒有與println語句進行通信。我對Java非常陌生,而且我非常失落,所以請基本解釋你的建議。我不但非常感謝答覆,而且也非常感謝你的解釋,我不會再犯這個錯誤。感謝您的時間。 /* * This program will simulate playing a slot machine.

    3熱度

    3回答

    在System.out.println,println是JAVA中的訪問器還是mutator方法? 謝謝....

    0熱度

    2回答

    我有一個ArrayList保持接觸。每個聯繫人在創建時由用戶分配一個ID。我如何參考ID來打印聯繫人的詳細信息。例如: Contact ID = 1。我想打電話從arrayList1並打印瓊·史密斯,123西聖等。 這裏是我正在創建的ArrayList: 主類: import java.util.ArrayList; import java.util.Scanner; public