Search:

Type: Posts; User: JoeBG

Search: Search took 0.23 seconds.

  1. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    Ok so i manage to compile everything.
    My current code is:


    public class Phone extends Gadget
    {
    private int credits;

    public Phone(String themodel, double theprice, int theweight,...
  2. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    I have't added anything extra. This is my entire code for the Phone class


    public class Phone extends Gadget
    {
    private int credits;

    public Phone(String themodel, double theprice,...
  3. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    Oh ok, so i've added the arguments to the super call and the error disappeared. Now i have another error for the 2nd part "credits = theCredits;" saying:
    cannot find symbol - variable theCredits

    ...
  4. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    The error message i'm getting now is:
    constructor Gadget in class Gadget cannot be applied to given types;
    required: java.lang.String,double,int,java.lang.String
    found: no arguments
    reason:...
  5. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    Ok so i removed the return and changed the constructor to Phone instead of Gadget but it still doesn't compile :(


    public class Phone extends Gadget
    {
    private int credits;
    private int...
  6. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    Well i think that i already have a constructor and a method but it still doesn't want to Compile..


    public class Phone extends Gadget
    {
    private int credits;
    private int balance;

    ...
  7. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    I'm sorry but i can't understand. Can you please give me an example? Am i supposed to add something before the super call?
    I probably look stupid right now but i really need to understand what my...
  8. Replies
    17
    Views
    965

    [SOLVED] Re: BlueJ inheritance Issue. Please Help.

    The error code is "call to super must be first statement in constructor". But i believe that it's already the first statement..
    There is also another message:
    constructor Gadget in class Gadget...
  9. Replies
    17
    Views
    965

    [SOLVED] BlueJ inheritance Issue. Please Help.

    Hello,

    I'm working on my coursework and the task is to create inheritance using "super"
    3473
    This is the structure.



    public class Gadget
    {
Results 1 to 9 of 9