In this video, Doug Winnie shows how to manage variables of different types and what happens if you try to combine strings and number types together in various combinations. He also introduces the toString and parseInt helper functions to help control variable types to force values to convert to specific types.
- [Instructor] As you work with Java,…you will create and manipulate variables…of many different types.…Java is a typed language,…meaning that you need to define what a variable can hold.…Because everything is typed,…you need to convert between types…and manage different types of variables.…Let's walk through some examples of how you can manipulate…your variables and control their value types.…First, let's create a number.…We'll create an integer called "myVariable",…and we'll set that equal to five.…
We can then create a string that will contain…the value of the variable and say what type it is.…We'll send that to the output console.…System.out.println,…we'll put in "myVariable is equal to",…and we'll add in the value of myVariable.…Then we'll say "and is an int."…Build and run the program and see what the output is.…
And we'll get the statement,…"myVariable is equal to 5 and is an int."…So our variable is an int…because we defined it as one on line 7.…Then, we assigned an integer to that variable.…But, if we want to take the integer variable…
- The history of Java
- Setting up your development environment
- Working with values and variables
- Using methods and functions
- Capturing user input
- Creating conditional tests
- Using loops
- Creating and changing arrays
- Object-oriented programming in Java
- Defining permissions
- Extending classes
Skill Level Beginner
Computer Science Principles: The Internetwith Doug Winnie59m 30s Beginner
Java Essential Training for Studentswith Peggy Fisher3h 6m Intermediate
1. Intro to Java
2. Define Actions Using Code
3. Repeat Actions and Test for Conditions
4. Object-Oriented Programming Basics
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.