Java修改错误问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 06:07:56
import javax.swing.*;
import java.util.Date;
public class Lab5Q1
{
public static void main (String [] args)
{

final String M0 = "Signs point to yes.\n";
final String M1 = "It is decidedly so. \n";
final String M2 = "Outlook good. \n";
final String M3 = "Reply hazy, try again.\n";
final String M4 = "Cannot predict now. \n";
final String M5 = "My sources say no.\n";
final String M6 = "Very doubtful. \n";
final String M7 = "Don't count on it. \n";
String inputString;

int rand;

String answer;

JOptionPane.showMessageDialog (null, "Welcome to the Magic 8-Ball!");

JOptionPane.showInputDialog ("Welcome to the Magic 8-Ball!" + "\nEnter a question for the 8 Ball or Cancel to end.");

while (inputString != null)

import javax.swing.*;
  import java.util.Date;

  public class Lab5Q1
  {
  public static void main (String [] args)
  {

  final String M0 = "Signs point to yes.\n";
  final String M1 = "It is decidedly so. \n";
  final String M2 = "Outlook good. \n";
  final String M3 = "Reply hazy, try again.\n";
  final String M4 = "Cannot predict now. \n";
  final String M5 = "My sources say no.\n";
  final String M6 = "Very doubtful. \n";
  final String M7 = "Don't count on it. \n";
  String inputString = null;

  int rand;

  String answer;

  JOptionPane.showMessageDialog (null, "Welcome to the Magic 8-Ball!");

  JOptionPane.showInputDialog ("Welcome to the Magic 8-Ball!" + "\nEnter a question for the 8 Ball or Cancel to end."