Expressions, Statements, and Blocks
Start course
Difficulty
Beginner
Duration
2h 12m
Students
97
Ratings
4/5
starstarstarstarstar-border
Description

In this course, we'll learn about Java data types and operators.

Learning Objectives

  • Variables
  • Data Types
  • Type Conversion & Type Casting
  • Operators
  • Operator Precedence 
  • Expressions, Statements and Block

Intended Audience

  • Anyone looking to get Oracle Java Certification
  • Those who want to learn the Java Programming language from scratch
  • Java developers who want to increase their knowledge
  • Beginners with no previous coding experience in Java programming
  • Those who want to learn tips and tricks in Oracle Certified Associate – Java SE 8 Programmer certification exams

Prerequisites

  • No prior knowledge is required about the Java programming language.
  • Basic computer knowledge
Transcript

Hi there. In this video, we will learn about Java Expressions, Java Statements, the difference between Expression and Statement, and Java Blocks. Now that we understand variables and operators, it's easy to learn about expressions, statements and blocks. We may combine variables and operators to form expressions. Expressions are the core components of statements. Statements may be grouped into blocks. Expressions consist of variables, operators, and method calls that evaluate to a single value. 

You see some examples of expressions illustrated in red color. Here, maxSpeed = 280 is an expression that returns int in data type. Int is not part of an expression. Typically, except data type and semicolon forms an expression. result = 5 + 8 is an expression and the result is now 13. In the brackets, (x+y) * 2.5 is an expression. Also, it's named as a compound expression. When writing compound expressions, be careful indicating with parentheses which operator should be evaluated first. number1 == number2 is an expression that returns boolean. Similarly, "Equal" is a string expression. 

Okay, let's look at the statements. Statement forms a complete unit of execution. Note that it's necessary to add a semicolon at the end of the statement. Expressions are part of statements. You see examples of statements in the slide. All examples are statements so they are illustrated in red color. Okay, finally, let's look at the blocks. A block is a group of zero or more statements that is enclosed in curly braces. You see the examples of block in the slide. There's one statement inside the block. A block may contain lots of statements. Now, let's take a short break here. See you in the next video.

 

About the Author
Students
1889
Courses
64
Learning Paths
4

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.

Covered Topics