Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Class final problem help

  1. #1
    Junior Member
    Join Date
    Apr 2020
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Class final problem help

    So, im in 11th grade and i like to program in java in my free times, my university friend came with this " final problem " that i got stuck thinking how i'd do it , the problem is...

    In a news agency many people work with different functions (journalists,
    editors, ...), who can be specialized in a certain area (economy, sport, ...) and who can be at different stages of their professional career. A news agency produces content (news, reports, photoreports, advertising, opinion articles, editorials, ...) and which can be of different types. The work does not need to cover all of these aspects.

    i created a class for the worker which the journalists photographers and editors extend the class worker and made abstract methods for the content, now my problem is the area
    how should i make the area? should i create another abstract class called Area and extend to get the areas of Economy and sport and how i'd introduce it as an object??

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Class final problem help

    What kind of state would an Area object hold? What variables and methods would be needed to support its state?
    Would an enum be a better model for Area?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Class final problem help

    Yes, enum is better option but have you tried boolean.
    Last edited by Vasquez1234; September 17th, 2020 at 04:14 PM. Reason: correction in data type

Similar Threads

  1. problem in final year project
    By hellzone110 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: August 11th, 2013, 10:49 AM
  2. private final class
    By thelegendery in forum Java Theory & Questions
    Replies: 1
    Last Post: May 29th, 2013, 06:23 AM
  3. [SOLVED] Final problem. printAlternate() method
    By javapenguin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 12th, 2010, 08:03 PM
  4. [SOLVED] A Final method for DoublyLinkedList and a new class that calls DoublyLinkedList.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 12th, 2010, 07:29 PM
  5. final class, final <variable> or <data member>
    By chronoz13 in forum Object Oriented Programming
    Replies: 9
    Last Post: September 20th, 2009, 08:19 AM

Tags for this Thread