|
下面的是我的代码中的一个類,主要问题就是在我添加DVD过后,再删除添加的DVD.然后添加新的DVD后就會报错
报错的是这句话 : if (dvd.name.compareToIgnoreCase("") == <font color='white'>Java学习者论坛</font>0) {
package com.jb.cdjj.s1t112.chapter16.t1;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class MiniDvdManager {
Scanner input = new Scanner(System.in);
MiniDvd[] dvd = new MiniDvd[100];
int index = 0;
int temp = -1;
/**
* do{ int temp = -1; temp = JOptionPane.showConfirmDialog(null,
* "<html><font color='red'>hong(红)se(色)的字</font><br>
* qi(其)ta(他)字</html>","choose one", JOptionPane.YES_NO_OPTION); }while(temp == 0);
*/
/*
* 建立主菜单,菜单选项有: 1.新增,2.查看,3删除,4.借出,5.歸还,6.退出
*/
public void menuDvd() {
initDvd();
boolean isRight = true;
do {
String num = JOptionPane
.showInputDialog("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
+ " ┏┯┓┏┯┓D ┏┯┓┏┯┓┏┯┓\n"
+ " ┠迷┨┠你┨ v ┇┠管┨┠理┨┠器┨\n"
+ " ┗┷┛┗┷┛ D ┗┷┛┗┷┛┗┷┛\n"
+ "-------------------------------------------------------------\n"
+ " ┏━━━━━━━━━┓ \n"
+ " ┃◤ 1.新增DVD ◥ ┃ \n"
+ " ┃ ┇ 2.查看DVD ゞ ┃ \n"
+ " ┃ ┇ 3.删除DVD ゞ ┃\n"
+ " ┃ ┇ 4.借出DVD ゞ ┃\n"
+ " ┃ ┇ 5.归还DVD ゞ ┃\n"
+ " ┃ ◣ 6.退chu(出)DVD ◢ ┃ \n"
+ " ┗━━━━━━━━━┛ \n"
+ " |
|