From the course: Java for All Platforms: Desktop, Web, and Mobile Development
Unlock the full course today
Join today to access over 23,500 courses taught by industry experts.
Variables - Java Tutorial
From the course: Java for All Platforms: Desktop, Web, and Mobile Development
Variables
- [Instructor] Because this is a basic Java course with really no prerequisites, we're going to go over the basics of the Java programming language. And we're going to start that conversation with variables. In Java, a variable is created by declaring, first, its data type, which, in this case, is String with a capital S, and then a space and the name of the variable. So let's call this my variable, capital V. And though it's not required in the language, the convention for Java is to name variables starting with a lowercase letter and then to use camel case, meaning each word in the variable starts with a capital letter, so just like this. You can set a value for a variable using the equal sign, so my variable equals. And then in double quotes, since we're using a string, the value of the variable. I'll just type in example value there. Now we have this red squiggly line here, because Java statements need to end…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Variables4m 4s
-
(Locked)
Functions4m 40s
-
(Locked)
Arrays and lists6m 17s
-
(Locked)
Conditional statements3m 45s
-
(Locked)
Classes and packages6m 14s
-
(Locked)
Input and output2m 26s
-
(Locked)
Read data from a file4m 12s
-
(Locked)
Handle Java errors3m 26s
-
(Locked)
Challenge: Sum of a list54s
-
(Locked)
-
-
-
-
-