Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Java's property name, which name is more correct?

In Java's property name, which name is more correct ?

  1. createDate
  2. creationDate
  3. createdDate
  4. others

Please tell me a better expression, because, I'm Japanese.

like image 527
Take Avatar asked Jan 06 '11 09:01

Take


People also ask

What is Property name example?

Definition: Identifies the property name that is displayed on the Property List; an easily recognizable or descriptive name; typically a street address or property name (e.g. “100 Main Street” or “Commerce Center Mall').

Which one is the correct class name as per naming convention?

Class names should be nouns, in mixed cases with the first letter of each internal word capitalized. Interfaces names should also be capitalized just like class names. Use whole words and must avoid acronyms and abbreviations.

Which of the following is are the best naming convention for package?

Naming Conventions Package names are written in all lower case to avoid conflict with the names of classes or interfaces. Companies use their reversed Internet domain name to begin their package names—for example, com. example. mypackage for a package named mypackage created by a programmer at example.com .

Which naming convention is used to name a method Java?

Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters.


3 Answers

Although English is not my mother tongue too I believe that creationDate is better because it means that this is the date when something was created.

createDate is irrelevant because it is command: Hey, man, create date! createdDate is speaking about the date itself and not about the date when something else was created.

I hope it helps.

like image 89
AlexR Avatar answered Sep 18 '22 00:09

AlexR


I would personally go for creationDate if it's a property name. If it's a method which creates a date, createDate would be more appropriate.

like image 29
Sanjay T. Sharma Avatar answered Sep 18 '22 00:09

Sanjay T. Sharma


just 'created', it's visible it's date from the type

like image 27
bestsss Avatar answered Sep 18 '22 00:09

bestsss