java编译提示非法的表达式开始,需要“;”

importjava.awt.event.*;importjavax.swing.*;importjava.awt.*;publicclassDeckOfCardsext... import java.awt.event.*;
import javax.swing.*;
import java.awt.*;

public class DeckOfCards extends JFrame
{
private Card Deck[];

private JButton Shuffle;
private JButton Array[];

private JPanel p1;
private JPanel p2;

private JLabel st;

private int now;

public DeckOfCards()
{
super("Card Grid game");
this.setDefaultCloseOperation(EXIT_ON_CLOSE);

String faces[] = { "Ace", "Deuce", "Three", "Four", "Five", "Six"};
String suits[] = { "Heart", "Diamond", "Club", "Spade" };

Deck = new Card[24];
now = -1;

for (int i = 0; i < 24; i++)
Deck[i] = new Card(faces[i % 6], suits[i / 6]);

public void Shuffle()
{
now = -1;

for (int i = 0; i < 24; i++)
{
int j = (int) (Math.random() * 24);
// Swap The Cards
Card t = Deck[i];
Deck[i] = Deck[j];
Deck[j] = t;
}
}
展开
 我来答
swallowliyi
2011-05-18 · TA获得超过2247个赞
知道小有建树答主
回答量:582
采纳率:0%
帮助的人:622万
展开全部
public DeckOfCards()
{
super("Card Grid game");
this.setDefaultCloseOperation(EXIT_ON_CLOSE);

String faces[] = { "Ace", "Deuce", "Three", "Four", "Five", "Six"};
String suits[] = { "Heart", "Diamond", "Club", "Spade" };

Deck = new Card[24];
now = -1;

for (int i = 0; i < 24; i++)
Deck[i] = new Card(faces[i % 6], suits[i / 6]);

public void Shuffle()
{

你在构造方法里面怎么能再定义方法呢?
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式