Boolean type The boolean is a data type that has only two possible values: false and true. This is also known as the logical type.
Characters
The char type is used to represent letters (both uppercase and lowercase), digits, and other symbols. Each character is just a symbol enclosed in single quotes.
Bitwise and bit-shift operations
As you probably know, in most cases, computer numbers are represented in binary format. In this format, each digit of a number can be represented as either 0 or 1. For example, the decimal value 15 is 1111 in binary format. We’ve already learned how to convert integer numbers to binary and perform some arithmetic operations with binary numbers. Now let’s learn how else you can work with binary numbers!
Switch statement
You already know how to shape the control flow of a program using if-else statements. Perhaps, you have faced situations when you had to stack and nest multiple if-else statements to get the desired result. In this topic, you will learn an alternative way to deal with multiple choices.
Switch expression
Java 12 introduced a new feature into the Java language called switch expressions, which can be used to simplify many switch statements. Switch statements are often used to avoid long chains of if and else if statements, generally making your code more readable.
Units of information
Throughout life, we always find something to measure: the amount of food we need to cook for the family, the length and width of that couch you want to put in the room, our weight and height. The latter is especially exciting: it’s really cool to learn that in just one year you grew by a full 2 inches!
Unicode
As you know, computers operate in binary code so, naturally, different kinds of symbols that we use need to be transformed into numbers. For this purpose, different encodings were created and implemented over the years.
Multiple constructors
Sometimes we need to initialize all fields of an object when creating it, but there are cases in which it might be appropriate to initialize only one or several fields. Fortunately, for this purpose, a class can have several constructors that assign values to the fields in different ways. In this topic, you will learn how to work with multiple constructors and define the way…
Python Switch Statement – Switch Case Example
Until version 3.10, Python never had a feature that implemented what the switch statement does in other programming languages.
You Should Be Using Python’s Walrus Operator – Here’s Why
The assignment operator – or walrus operator as we all know it – is a feature that’s been in Python for a while now (since 3.8), yet it’s still somewhat controversial and many people have unfounded hate for it. In this article I will try to convince you that the walrus operator really is a good addition to the language and that if you use it properly,…