Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3281182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:47:15+00:00 2026-05-17T19:47:15+00:00

Say I got an Employee class that has a hire date data member. This

  • 0

Say I got an Employee class that has a hire date data member. This member only get set one time only and it is constant too. So it’ll get initialised when the object is created.

If I want the class to have a method that returns the hire date, what’s better:

getHireDate();

Or just:

hireDate();

Am I thinking too much 😀 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:47:16+00:00Added an answer on May 17, 2026 at 7:47 pm

    Just

    getHireDate();
    

    is fine. It doesn’t need a ‘set’ method to be proper OO.

    Edit: if you haven’t yet, read some Java Coding Style docs… they’re simple enough, and standard coding conventions make everybody’ life easier. I just found this: Java Programming Style Guidelines. Good reading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I've got a class where the sole data member is something like std::string
Say we've got a class like public class Doer { public int Timeout {get;set;}
Say I've got a domain model created from C# classes like this: public class
Say I got 3 entities: Business, Employee and Payment. A payment has a foreign
Let's say I got a textfile.txt that I want to read from. This is
Say I got this situation: I have to filter one of my entities with
Let say I got this page: <body> <h1>Hello!</h1> <div class=wrapper> <div class=anotherclass> <h1>Another heading
Let's say i got this: public class Foo{ public string Bar; } Then i
Say I got a simple class with one public and one private method. If
Let's say I got a table like this: data <- c(1,2,3,6,5,6,9,LC,LC,HC,HC,LC,HC,ALL) attr(data,dim) <- c(7,2)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.