Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:19:29+00:00 2026-05-30T20:19:29+00:00

I’ve learned Java for 1 month. This time, I’d like to create a poker

  • 0

I’ve learned Java for 1 month.
This time, I’d like to create a poker game.
There are two questions about my program.
I hope somebody can help me to fix it.

  1. Each card has it value, for A as 1, king as 10, but I find out that this is a String array. How could I give each “String value “as “int value” so that I can do the operation?

    String[] suits = { "hearts", "spades", "diamonds", "clubs" };
    String[] number = {"A","2","3"......};
    
  2. I hope this system can use random number to chose cards at first, and second time when it run, it can void previous number (There have 52 card). Does there has something that I can do to figure out this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:19:30+00:00Added an answer on May 30, 2026 at 8:19 pm

    What you should be considering for this sort of classification is Enums:

    public enum Suit {
      Hearts, Spades, Diamonds, Clubs;
    }
    public enum Card {
      A, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K;
    }
    

    This benefits your situation since enums can be assigned value easily, to whatever you like, and then they can be compared based on this value.
    In fact, the Java documentation provides a card game for the introduction to enums.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’ve learned Java for 1 month. I have a question about my code. There
So I'm learning java. I'm one month in and I just learned about constructors.
When I learned Java, I was told that the arraylist works this way: It
I learned the object-oriented in Java. Now in develop in C#. This means that
I just learned about how the Java Collections Framework implements data structures in linked
I'm a student in Java class and learned something about Java today that made
I'm currently making a pacman game in java. I have a question about the
I just learned about Java's Scanner class and now I'm wondering how it compares/competes
I just learned about java.sql package . It uses Class.forName() to dynamically load the
One of the first things I've learned about Java EE development is that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.