#Output not updating even with change in code.

1 messages ยท Page 1 of 1 (latest)

craggy cairnBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Im attempting to output attributes of an object from an inheritance class but Im only getting output from the code before I made several changes. I rebuilt the program multiple times before running and even restarted my pc and the output is still not happe

t the project and checked for any errors in the code, but the output still does not update.

Possible reasons for this issue could be:

  1. Caching: The previous output may be cached, try clearing the cache or restarting the application to see the updated output.
  2. Compile errors: Make sure there are no compile errors in your code that are preventing the changes from being reflected in the output.
  3. Inheritance issues: Double-check that you are correctly accessing and printing out attributes from the inherited class.

To troubleshoot further, you can try:

  1. Adding print statements at different points in your code to see where it is getting stuck.
  2. Debugging your code to step through it line by line and identify any potential issues.
  3. Checking for any runtime exceptions that may be occurring and preventing the updated output.

If you are still unable to resolve the issue, consider seeking help from others on forums or communities like this one for further assistance with your specific code implementation.

restive geyser
#
  private String title;
    private String author;
    private double price;
    private String isbn;
Book(){}
Book(String title, String author, double price, String isbn){
    this.title = title;
    this.author = author;
    this.price = price;
    this.isbn = isbn;
}
public String getAuthor(){
    return author;
}

public String getTitle(){
    return title;
    }
public double getPrice(){
    return price;
}
public String getIsbn(){
    return isbn;
}
public void setTitle(String title){
    this.title=title;
}
public void setAuthor(String author){
    this.author= author;
}
public void setPrice(double price){
    this.price=price;
}
public void setIsbn(String isbn){
    this.isbn=isbn;
}
@Override
void displaydetails()
{
    System.out.println("This books title is " + getTitle()+ ", author "+ getAuthor()
            + " price "+ getPrice() + "and isbn is " + getIsbn());
}
public static void main(String [] args){
 EBook b1 = new EBook("Top 10 Pizza Shops","John Pork",199.9,"123213-1-546",111,"Word document");
 b1.displaydetails();
}   
}
craggy cairnBOT
restive geyser
#
    
    abstract void displaydetails();
}
``` this is the super class that book is inherting from
craggy cairnBOT
restive geyser
#
    private double filesize;
    private String format;
    EBook(){}
    EBook(String title, String author, double price, String isbn, double filesize, String format){
        super(title,author,price,isbn);
        this.filesize = filesize;
        this.format = format;
    }
    public double getFilesize(){
        return filesize;
    }
    public String getFormat(){
        return format;
    }
    void setFilesize(double filesize){
        this.filesize = filesize;
    }
    void setFormat(String format){
        this.format= format;
    }
    
    @Override
    public void displaydetails(){
        super.displaydetails();
        System.out.println( getFilesize()+" ,format is" + getFormat());
        }
}```  subclass which inherits from book