---
schema_version: "1"
id: 4d907f0c0ab88f84b5eebe65f9ac5457e61e8c2508b3f6550f7071b2a2330e21
title: Naming Conventions
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_classes_naming_conventions.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_naming_conventions.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e6c43cce7e9d4da796c0008423698cac0286fd184fa28069ef9590874c81b0d6
---
# Naming Conventions

We recommend following Java standards for naming, that is, classes start with a capital letter, methods start with a lowercase verb, and variable names should be meaningful.

It is not legal to define a class and interface with the same name in the same class. It is also not legal for an inner class to have the same name as its outer class. However, methods and variables have their own namespaces within the class so these three types of names do not clash with each other. In particular it is legal for a variable, method, and a class within a class to have the same name.

- [Next →](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_name_shadowing.htm "Name Shadowing")

#### See Also

- [Variables](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_variables.htm "Local variables are declared with Java-style syntax.")