Languages
[Edit]
EN

Java - class, utils, interface, variables - naming convention - ideas and examples

4 points
Created by:
Bartek
2120

Class or fields should be named as noun.

Class naming ideas in java - keywords:

  • Reader
  • Writer
  • Builder
  • Mapper
  • Executor
  • Changer
  • Manager
  • Service
  • Component
  • Repository
  • Exchanger
  • Context
  • Status
  • Consumer
  • Producer
  • Optimizer
  • Scheduler
  • Crawler
  • Path
  • File
  • State
  • Synchronizer
  • Analyzer
  • Collector | Collectors
  • Provider
  • Converter
  • Fetcher
  • Detector
  • Processor
  • Generator

Class naming ideas in java - services:

  • ContextManager
  • ConnectionManager
  • ContextProvider
  • FileScheduler
  • FileGenerator
  • FileProducer
  • FileConsumer
  • UserRepository
  • UserService

Class naming ideas in java - collections / objects:

  • Object
  • List (ArrayList, LinkedList, Vector)
  • Queue (PriorityQueue)
  • Stack
  • Map (HashMap, Hashtable)
  • Set (HashSet, TreeSet)

Utils class naming ideas in java:

  • FilesUtil
  • PathsUtil
  • StringUtil
  • MathUtil
  • Base64Util
  • DateTimeUtil
  • DomainUrlUtil
  • HtmlUtil
  • IpUtil
  • LoggerUtil
  • PageContextUtil
  • PathsUtil
  • RandomUtil
  • SqlUtil
  • UrlConverterUtil
  • Files
  • Config

Interface naming ideas in java:

  • Comparable
  • Comparable
  • Serializable
  • Runnable
  • Callable
  • ConcurrentNavigableMap
  • ConcurrentMap
  • Delayed
  • BlockingDeque
  • BlockingQueue
  • Executor
  • CompletionService
  • CompletionStage
  • ExecutorService
  • Future
  • RejectedExecutionHandler
  • RunnableFuture
  • RunnableScheduledFuture
  • ScheduledExecutorService
  • ScheduledFuture

Constants

  • FileConstants
  • UserConstants
  • DomainConstants

Enum naming conventions

  • CategoryType
  • CategoryTypes
  • CategoryEnum
  • DocumetMode (read, write)
  • UserRole (admin, moderator)

Other examples:

  • PostCreatorController
  • PostFinderController

Also take a look at post with java methods naming convention and examples here:

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - conventions, naming, best practices

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join