【发布时间】:2013-12-21 18:17:43
【问题描述】:
我正在从数组中读取数字,然后使用我的 BubbleSort 类对数组中的数字进行排序。我正在努力让 BubbleSort 类的电话正常工作。
//Attempted call from the main class to the BubbleSort method in the BubbleSort class
System.out.println(this.BubbleSort.BubbleSort());
//冒泡排序类
主包;
公共类 BubbleSort {
private static void BubbleSort(int[] num) {
for (int i = 0; i < num.length; i++) {
for (int x = 1; x < num.length - i; x++) {
if (num[x - 1] > num[x]) {
int temp = num[x - 1];
num[x - 1] = num[x];
num[x] = temp;
【问题讨论】:
标签: java class object methods call