• Java IO
  • Spring
  • JavaScript
  • JSP
  • RubyonRails
  • Struts
  • PHP
  • Servlet
  • Core Java

  • <

    What is Java Variable and Datatypes

    Variable is memory location name to be allocated.There are three types of variables in java:

    Java Variable Types

  • local variable

  • instance variable

  • static variable

  • Local variables are declared in method, constructor, or block.
  • Instance variables declared inside class, but declared outside a method.
  • static variables declared using static keyword in a class,

  • Java Variable and Datatypes Example

    class A{  
    int data=50;//instance variable  
    static int m=100;//static variable  
    void method(){  
    int n=90;//local variable  

    Java Data types

    int(Data type) a,b,c;
    float(Data type) pi;
    double(Data type) d;
    char(Data type) a;

    © copyright 2017-2022 Completedone pvt ltd.