Naming Conventions

Naming Conventions

{sec:naming_conventions}

Java has some very handy naming conventions.

  • Class names always start with an upper case letter. For example, Scanner, System, Hello
  • Method names always start with a lower case letter, and use camelCase to represent multiword method names. for example nextInt()
  • Instance variables of a class start with a lower case letter and use camelCase
  • Constants are in all upper case letters. for example Math.MAXINT

License

Icon for the Creative Commons Attribution 4.0 International License

CSC297 – Java for Python Programmers Copyright © by Creative Commons Attribution is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.