Variables in Java

Variables are memory location identifiers used to temporarily store data in a program. Variables have two basic parts: Name and type. Variable name is the name of the memory location where the variable is stored and variable type is the data type of the variable which is choosen at the time of declaration.

Program Output




 

public class TestVariable {
   public static void main(String[] args) {
      
     
     int cadence = 0;
int speed = 0;
int gear = 1;

System.out.println(gear);

   }
}
   
This code will initialize the variables with assigned values and print the values as and when commanded.

Download Source code 'Variable Class'

References : Oracle | Wikipedia share on :        :  

Love to hear your Views / Guidance / Recommendations on this Post…

Explore the Technology World

Path Setting in Java When an application is launched from command prompt Windows OS searches for the executable program in the current working directory. The prompt throws an error ...Read MorePicture-in-Picture App for Android devices with Source CodePicture-in-Picture is a special type of multi-window mode mostly used for video playback for Android devices.Released under Apache License 2.0 , which means you ...Read Moreopen source free template for personal or company blogsLooking for perfect theme for personal or company blogs.Released under the MIT license, which means you can use this template for any purpose, even for commerci ...Read MoreHow to Build an App for the Google AssistantApps for the Google Assistant are the gateway for your users to engage with your services through Google Home, Android phones, iPhones.Watch here to build an as ...Read MoreIntroduction to AMP - Accelerated Mobile PagesAMP, short for Accelerated Mobile Pages, is new new open source initiative to make the mobile web awesome again.Watch Here the Introduction to AMP ...Read MoreHadoop - Just the Basics for Big Data Rookies (Best online tutorial)This Tutorials assumes absolutely no knowledge of Apache Hadoop and will provide a complete introduction to all the major aspects of the Hadoop ecosystem of pro ...Read More

Call / Visit for New Batch

Services

Why Join Us

  • ➯ Free Demo Classes
  • ➯ No Registration Fee
  • ➯ Interview Questions
  • ➯ Study Materials
  • ➯ Softwares
  • ➯ Aptitude & Reasoning
  • ➯ Placement Assitance

Address

  • MyJava Training Institute ,
  • Plot No.243 , shop No 14 ,
  • Secnd Floor , Zone-II ,
  • M.P.Nagar , Bhopal,
  • Madhya Pradesh ( 462011 )
  • ☎  08871209400 , 7987028543
  • 🌐 www.myjava.in
FacebookGoogle +TwitterYouTube

MyJava - java Training Institute