Click here to Skip to main content
15,914,222 members
Home / Discussions / Java
   

Java

 
Questiondecryption with AES Pin
mesho15-Nov-09 8:51
mesho15-Nov-09 8:51 
AnswerRe: decryption with AES Pin
Richard MacCutchan15-Nov-09 21:56
mveRichard MacCutchan15-Nov-09 21:56 
GeneralRe: decryption with AES Pin
mesho16-Nov-09 1:18
mesho16-Nov-09 1:18 
GeneralRe: decryption with AES Pin
Richard MacCutchan16-Nov-09 1:44
mveRichard MacCutchan16-Nov-09 1:44 
GeneralRe: decryption with AES Pin
mesho16-Nov-09 2:21
mesho16-Nov-09 2:21 
GeneralRe: decryption with AES Pin
Richard MacCutchan16-Nov-09 2:56
mveRichard MacCutchan16-Nov-09 2:56 
QuestionLoading different implementations of a class Pin
Klazen14-Nov-09 15:38
Klazen14-Nov-09 15:38 
AnswerRe: Loading different implementations of a class Pin
Nagy Vilmos15-Nov-09 22:29
professionalNagy Vilmos15-Nov-09 22:29 
Inheritance is your friend! This is the classic example of using it.
Start with your nice basic abstract class:
abstract class Card
{
  // put any common stuff in:
  private String description;

  Card(String description)
  {
    this.description = description;
  }

  // ... etc

  // add in any abstract stuff:
  abstract void onPlay();
  abstract void onDiscard();
}

Then for each type of card you need, have another class:

class RealCard extend Card
{
  RealCard()
  {
    super("This is a real card");
  }

  void onPlay()
  {
    // stuff
  }
  void onDiscard()
  {
    // other stuff
  }
}


That is the better way to design things.

The second part of how to store the objects is covered by a simple enough idea - serialization. Get your card classes right and hard code them to start with, then worry about the persistaance; it should be relatively easy.



Panic, Chaos, Destruction.
My work here is done.

GeneralRe: Loading different implementations of a class Pin
Klazen16-Nov-09 7:30
Klazen16-Nov-09 7:30 
Questionsharing a directory/folder in Java Pin
VontinaAlexa13-Nov-09 5:52
VontinaAlexa13-Nov-09 5:52 
AnswerRe: sharing a directory/folder in Java Pin
David Skelly13-Nov-09 6:23
David Skelly13-Nov-09 6:23 
GeneralRe: sharing a directory/folder in Java Pin
VontinaAlexa13-Nov-09 6:33
VontinaAlexa13-Nov-09 6:33 
Questionjava servlet - error HTTP 500 - java.lang.nullpointer exception Pin
golisarmi11-Nov-09 1:01
golisarmi11-Nov-09 1:01 
AnswerRe: java servlet - error HTTP 500 - java.lang.nullpointer exception Pin
David Skelly11-Nov-09 2:32
David Skelly11-Nov-09 2:32 
GeneralRe: java servlet - error HTTP 500 - java.lang.nullpointer exception [modified] Pin
golisarmi11-Nov-09 2:43
golisarmi11-Nov-09 2:43 
GeneralRe: java servlet - error HTTP 500 - java.lang.nullpointer exception Pin
sparlay_pk16-Nov-09 7:49
sparlay_pk16-Nov-09 7:49 
QuestionSaving Forms to an XML file or .txt file Pin
Clement Tientcheu10-Nov-09 18:20
Clement Tientcheu10-Nov-09 18:20 
AnswerRe: Saving Forms to an XML file or .txt file Pin
sparlay_pk16-Nov-09 7:56
sparlay_pk16-Nov-09 7:56 
Questiondeploying java database application Pin
Muhammad Adeel Zahid9-Nov-09 8:08
Muhammad Adeel Zahid9-Nov-09 8:08 
QuestionHow to Validate XML against XSD v1.1 Pin
Skippums9-Nov-09 7:08
Skippums9-Nov-09 7:08 
QuestionTable locked and session was invalidated Pin
tarek.mostafa8-Nov-09 23:11
tarek.mostafa8-Nov-09 23:11 
QuestionNeed help with building a compiler that takes regular expressions in Java Pin
Jesus877-Nov-09 20:44
Jesus877-Nov-09 20:44 
AnswerRe: Need help with building a compiler that takes regular expressions in Java Pin
Nagy Vilmos8-Nov-09 22:16
professionalNagy Vilmos8-Nov-09 22:16 
GeneralRe: Need help with building a compiler that takes regular expressions in Java [modified] Pin
Jesus8710-Nov-09 9:29
Jesus8710-Nov-09 9:29 
QuestionPokerHand class can someone help me solve this code? Pin
sweetbab7-Nov-09 19:55
sweetbab7-Nov-09 19:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.