≡ Menu

Variables – Java Tutorial Podcast Episode 2

How to Program with Java iTunes Subscribe

Fundamentals of Programming with Java

– All programming languages share common traits
– Java in particular is an Object Oriented programming language
– Everything can be represented as an Object (think of of nouns in the English language)
– a Chair, a Desk, a Person, a User etc.


– What is a variable?
– In computer programming, a variable is a storage location and an associated symbolic name which contains some known or unknown quantity or information, a value.

– cryptic, here’s what it really means:
– Store information for later use, and store it in a way that you can reference it
– this is known as a variable name!
– variable name is just a word, a word that represent’s what you’re storing

– if you go to a website, website asks for your name, you type it in, boom that’s a variable

Variables have Types

– String – store a regular sentence (alphanumeric – numbers and letters)
– Integer – Whole numbers on (no decimals)
– Double – Number with decimals (about 16 significant figures)
– Float – Number with fewer decimal places than Double (about 8 significant figures)

Rules for Creating Variables

  • Variables should start with a lower case letter
  • Variables shouldn’t have spaces in their names (it’s not allowed)
    • If you absolutely HAVE to simulate a space in a variable name, use an underscore (_)
  • If your variable has multiple words in it, just use camel casing, for example:
    • String thisIsMyVariableNameWithoutSpacesAndItUsesCamelCasing
    • Note: as a rule of thumb, variable names should be no more than 4 or 5 words stuck together
  • You can’t begin a variable name with a number, it has to be a letter or an underscore (_)
  • Your Homework


{ 4 comments… add one }
  • John David Tupper February 1, 2013, 9:44 pm

    Hi Trevor,

    Great stuff with the podcast. Love that you include homework in the show notes.

    I am a little confused about the site navigation at the top of the page. Where is the podcast button like SPI?
    Am I missing the location of the podcast show notes? I listened to the podcast and added /session1 and session2. On iTunes I see you have 14 shows to the podcast. Is there a navigational way to get to this content (show notes) or do I just need to know to type the session number and it’s kind of hidden content?

    Even after I stumble on one session of show notes there is no navigation between them.

    Thanks I am a big listener of Pat Flynn and John Lee Dumas great interviews.

    • Trevor Page February 2, 2013, 9:32 am

      That’s an excellent point you bring up John. I’m going to see what I can do to fix that up today.

      Thanks for your kind words and your suggestions, it’s so valuable to me to get this kind of feedback!

  • Ali May 2, 2016, 4:47 pm

    Would you please give the direct feed URL for the podcasts collection?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Next post:

Previous post: