Important Announcement
Forum has been made read-only. Please click here for more information or here to return to VGFacts.

Users browsing this thread: 4 Guest(s)
Some programming help?
#1
So, I need to create three classes in Java (Well BlueJ) and I understand how to create two of them, but not the other.

Basically, I need to create a field with a string variable to represent the title of a book, but I'm not sure how. The other two classes represent the length of the book in chapters and the remaining chapters left in the book.

My code is sort of like this.

public class Textbook
{
    private String "booktitle";
    private int chapters;
    private int chaptersleft;
}

I get that "Int" stands for integer and numbers should be placed in there (so int chapters can be 25, indicating 25 chapters) but I'm not sure how I'm meant to give my book a title. I'm not entirely sure if I should give it a title, or if I'm meant to create code that ALLOWS you to input a title for said book.

Any help would be appreciated. I don't really know where to post this on the internet, so I'd rather do it on a forum I know. I get confused on the basic stuff a lot of the time.

Also, any guides or websites/books that could help would also be great.
Reply
#2
Its been a while since I've screwed with Java so my memory's a bit fuzzy in regards to it. I wasn't very good anyway.

http://www.homeandlearn.co.uk/java/user_input.html

Does this help?
Reply


Forum Jump: