Types of variables in Java programming

September 3, 2020 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

What are the types of variables in Java ?

Ans. The types of variables in Java are-
  1. Instance variable
  2. Static variable
  3. Local variable

class EEN{  
int age=20;//instance variable  
static int a=30;//static variable  
void show(){  
int b=40;//local variable  
}  
}

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion