d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Blackjack / Card Program > Need Help With 1 Part Pls
Prev123
Add Reply New Topic New Poll
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Feb 20 2013 02:17pm
what the shit. you don't know how to code but you're dicking around with reflection?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Feb 20 2013 07:13pm
Quote (shinigamiapple777 @ Feb 19 2013 08:32pm)
could still use help with this. atm im trying to figure out 1. why i'm getting errors:

Code
res = Reflection.filterMethods(this, getDeclaredMethods0(publicOnly));
if ((res = searchMethods(privateGetDeclaredMethods(true),
 Method method = getMethod0(name, parameterTypes);


:unsure:
Quote (irimi @ Feb 20 2013 03:17pm)
what the shit.  you don't know how to code but you're dicking around with reflection?


:wallbash:

Quote

and 2. about abstract classes : I have an abstract class Game, and a class called BlackJack. BlackJack extends Game. in my GameConsole class, I have Game blackjack = new BlackJack();    how do i call methods from the BlackJack class?

or if i try:
Code
BlackJack test = new BlackJack();
               test.playGame();


i get error:
Exception in thread "main" java.lang.NoSuchMethodError: BlackJack.playGame()V


if "playGame()" doesn't exist, this shouldn't even compile. so why do you have a runtime exception? make sure it's defined in class Game
Member
Posts: 4,625
Joined: Jul 3 2009
Gold: 6,520.00
Feb 20 2013 08:04pm
I have playGame() in my BlackJack class. The whole point of it is (sry but just explaining it so I get my thoughts written down): the Game class is abstract, that abstract class has - abstract instructions, abstract welcome message, and abstract playGame. That means that every time i extend the Game class, i.e. my BlackJack class extends Game class, it will need to define these methods. So playGame has to be different with every game created.

Quote (carteblanche @ Feb 20 2013 09:13pm)
:unsure:


:wallbash:



if "playGame()" doesn't exist, this shouldn't even compile. so why do you have a runtime exception? make sure it's defined in class Game


it is defined in class Game as :

Code
public abstract void playGame();


then in my BlackJack class as:

Code
@Override
public void playGame() {

      ...code...
}


This post was edited by shinigamiapple777 on Feb 20 2013 08:08pm
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Feb 21 2013 04:03pm
No one will be able to help you until you're willing to post all your code.

and still, I repeat:
Quote (irimi @ Feb 20 2013 01:17pm)
what the shit.  you don't know how to code but you're dicking around with reflection?

Go Back To Programming & Development Topic List
Prev123
Add Reply New Topic New Poll