Java Programing laungage

Core Java Tutorial

Introduction of Core Java

How To Install JDk and Set of Path

Syntax of java Program

Difference between Java and C/C++

Advantage and Disadvantage of Java

What is Java

Why Java is not Pure Object Oriented Language

Java has Following Features/Characteristics

Limitation of Java Language and Java Internet

Common Misconception about Java

Simple Program of Java

Integrated Development Environment in java

Compile and Run Java Program

Applet and Comments in Java

Tokens in Java

Keywords in Java

Identifier and Variables in Java

Literals/Constants

Data Type in Java

Assignments and Initialization in Java

Operators in Java

Rule of Precedence in Java

Operator on Integer and Separators in Java Programming

Java Control Flow of Statements

If and If-else Selection Statement

Nested If-else and If-else-If Selection Statement

switch case and conditional operator Selection Statement

for and while Loop

do..while and for each Loop

break and labeled break statement

continue and labeled continue statement

return Statement and exit() Method

Escape Sequence for Special Characters and Unicode Code

Constants and Block or Scope

Statement in Java

Conversions between Numeric Types in Java

Import Statement in Java

User Input in Java using Scanner Class

User Input in Java using Console Class

Array in Java

One Dimensional Array

Two Dimensional Array

Two Dimensional Array Program

Command Line Argument in Java

String args Types in Java

Uneven/Jagged array in java

Math Class Function and Constant

Math Class all Function used in a program

Enumerated Types in Java

Object Oriented Programming v/s Procedural Programming

Object Oriented Programming Concepts in Java

Introduction to Class,Object and Method in Java

Class Declaration in Java

Class & Objects in java

Encapsulation in Java

Modifiers/Visibility for a Class or Interrface or member of a Class

Polymorphism in Java

Runtime polymorphism (dynamic binding or method overriding)

adplus-dvertising
Identifier and Variables in Java
Previous Home Next
  1. Identifier is a name of a variable or an array or an method or a class or an interface or a packaged is called as identifier.
  2. forexample:
    int n;
    
    int a[];
    
    void m( ); etc.
  3. identifiers must start with a number ,letter,under score or a dollar sign.
  4. some valid identifiers are :
    $name
    _pet
    animal
    11123class
Identifier Java Naming Conventions
  1. Packages:Package names should be in lowercase.
    Example: package myfirstpackage;
  2. Classes or Interface:class names should be in TitleCase.
    Example:class MyFirstClass
  3. Methods:Names should be in camelcase.
    Example: void myFirstMethod();
  4. Final Variables:Names should be in upeer case.
    Example:final int Max=5;
    Variables

    Variable is named location which is value hold in primary memory whose value keep changed during execution is called as variable. Before variable must be declared after it is used. Variable is a name of memory location. variables are location in memory in which values can be stored you declare the variables after that you assign the values.

    1. First letter cannot be a digit.
    2. forexample:

      int abc123; is valid
      
      int 7abc;is not valid
      
      int _abc; is valid
      
      int &abc;
    3. It can not contain dot(.) ,space and other special symbol
    4. forexample:

      int g.s; is not valid
      
      int gross salary; is not valid
      
      int gross @ salary; is not valid
      
      int gross_salary; is valid
    5. Variable name can not match with any keyword.
    6. forexample:

      int a; is valid
      
      float if; is not valid 
      
      float c; is valid
    7. All identifier are case sensative.
    8. Their is no limit on length of identifier.
    9. Types of variables:There are three types of variables in java.
      1. local variable
      2. Instance variable
      3. static variable

      Local Variable: A variable that is declared inside the method is called local variable.

      Instance Variable: A variable that is declared inside the class but outside the method is called instance variable. It is not declared as static.

      Static variable: A variable that is declared as static is called static variable. It cannot be local.

      Example to understand the types of variables

      class A
      
      { 
           int data=50;//instance variable 
           static int m=100;//static variable 
           void method()
      
           { 
                int n=90;//local variable 
           } 
      }//end of class 
    Previous Home Next