Kathryn introduces common Java data types. She shows you how to create a Java class and add properties—or attributes—to this class with variables. These variables will make up the basis of your blueprint that you will use later to create objects that you can interact with in your code.
- [Narrator] Moving back to the code,…let's start by creating our blueprint,…a new class called car in code.…So we're going to go to the sourcecode folder again,…we're going to go new Java class, because we want to create…this Java car class, this car blueprint,…that we mapped out in the previous video,…and we're going to go Car as its name, it's going to be a class,…now we have this car class.…In our sketches from the last video…we said a car has an average miles per gallon,…a license plate number and a paint color.…
Starting with the average MPG,…we'll create a variable called average miles per gallon…and give it the data type int.…So we'll go int average miles per gallon.…Now I'm writing this in camel case,…and camel case just means that every word except the first…is capitalized, and this is a common convention in Java…when writing variable names.…In Java, when we create variables,…we have the data type followed by the variable name.…And so here our data type is int,…and int stands for integer, meaning whole number,…
- Downloading Java 9 and choosing an IDE
- Understanding Java basics: data types, strings, arrays, and more
- Controlling flow with functions and loops
- Working with inheritance and interfaces
- Learning lambda
Skill Level Beginner
1. Getting Started
2. Java Basics
3. Control Flow
4. Beyond the Basics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.