Java – Introduction

In this post, we will learn the introduction of java. 


What is Java

A general-purpose computer programming language designed to produce programs that will run on any computer system.

Slogan of JAVA

“Write once, run anywhere” (WORA),

Features of java: –

Why Java

  1. Easy to learn
  2. It is an object-oriented programming language.
  3. It has a Rich API.
  4. powerful development tools
  5. great collection of open source libraries.
  6. wonderful community support.
  7. Free
  8. Excellent documentation
  9. Platform independent.
  10. Scalable
  11. Great Carrier opportunities.

Naming Convention

In java, mainly the following entities are there. There is some standard for naming every entity. It is not forced but it is suggested to follow. 

  • Package

The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.  

Subsequent components of the package name vary according to an organization’s own internal naming conventions. Such conventions might specify that certain directory name components be division, department, project, machine, or login names.

  • class

Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive.

Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).

  • Interface

Interface names should be capitalized like class names.

  • Methods

Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.  

  • Variable

Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. 

Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.

  Variable names should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use.   

One-character variable names should be avoided except for temporary “throwaway” variables. 

Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters

  • Constant

The names of variables declared class constants and of ANSI constants should be all uppercase with words separated by underscores (“_”).

ANSI constants should be avoided, for ease of debugging.


Naming Convention

  1. Constant should be in Uppercase.
  2. The variable name should start with lowercase.
  3. Method name starts with lowercase and it should be a verb.
  4. package name starts with lowercase.
  5. The interface name should start with an uppercase letter.
  6. The class name should start with an uppercase letter.

And if you have a long name consisting of more than 2 words then always starts the second word with uppercase letter.   Example:   if we want to make a variable whose name is myarray- (it consists of my and array). so make the “A” of array in upper case.


0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x