We just completed the chapter on that we must have completed around 70 percent of the language business 2
in this chapter. 3
We studied about the court building blocks of matter like operators unconfrontable segments which are 4
useful in building meaningful logic. 5
We also have that variable scoping rules which is different building the program a particular variable 6
can be used. 7
Now let's look at some of the important points we covered in this chapter. 8
That began with Artomatic operators which are applicable only on primitive numeric types. 9
That is to apply to all primitives except boolean one exception must bless all pricker which can also 10
be used for concatenating strings. 11
Vitruvian look at when discussing strings we also look at few important rules that may come into play 12
when using Artomatic operations. 13
First one is operator precedence. 14
It is useful when an expression involves multiple operators on the order in which operations should 15
be applied is not clear from the expression in this case rules could be applied to frustrate gives preference 16
to multiplicative operations or are they do operations. 17
Second rule is that operate within the same group will be evaluated from left to right. 18
Next role was open and promotional. 19
And according to this rule operate in smaller than AInc data type are promoted in third rule is that 20
if both our parents are of same type then the final value of the operation will also be of the same 21
type as the two options find you is that if both operands belong to different types then the value of 22
the smaller type is automatically promoted to larger readership. 23
These rules are very important especially the last two. 24
Sometimes developers are not aware of these rules and consequently they are never clear on why certain 25
art expressions produce certain reasons. 26
Next will look that comparison. 27
Unlogical operators comparison operators compare one opening with another and there are also two foot 28
lessoned relational operators there are several comparison operators. 29
But if you want to check whether you object references or reference the same object or not then we can 30
use equal do not equal to operators. 31
These operators are also useful for performing null checks and avoiding runtime errors like multi-point 32
or exception. 33
Logical operators are useful. 34
If you want this money to bail conditions to perform some action. 35
An among the logical operations and an auto operators are shops so good operators next we look that 36
big rise and big shift operators which operate at big Levan you may never use them unless you're doing 37
some low level complex programming work. 38
Both of them are especially useful in resource constrained applications because operators operate on 39
only integer and boolean parameters they're used with Boolean is pretty rare. 40
And so they are mostly seen with integer primitives you've got what it does on the other hand operate 41
only on indigent primitives on the shift bench on either right or left direction. 42
Left shift operator response do multiplication by Bell or softball. 43
While unsigned right shift operator response or division by power or software such bit shifting is much 44
faster than performing multiplication and division and hence they are useful. 45
Their performance is critical. 46
Unhitched are some obligations of these operators if you recall because because the Djala use this is 47
all it goes and it's Hashima structure which is an implementation of Hosty and specifically it is used 48
in something called hash function hash map and has tables that will be discussed when we are covered 49
in data structures. 50
After all but it does believe it can go for all segments and switch treatment was one of them one important 51
thing about switches that the switch expression which is used in parentheses has to be an integer string 52
are in them so it cannot be anything else. 53
And one important question we are just going to prefer switch statement or an IF statement. 54
And here are some possible reasons for you to consider using it switch. 55
One reason as if it improves readability. 56
Next is in debt. 57
That is by using a switch program that is deliberately making a statement that only one variable is 58
inborn finally speed due to the way it is internally implemented it switches faster than if. 59
If there are too many conditions to dust then you may want to use a switch you can use a profiler like 60
Gabe profiler and it can help you in making this decision. 61
We also looked at the recommendation from effective Java. 62
And it is item 46 and it said prefer for each nubes traditional for Loeb's specific do it did it in 63
data structures like ours. 64
It provides a billion nursing backs as it hides some of the expressions used in a conditional statement 65
like the condition expression under expressionless parts. 66
This also reduces opportunities for errors. 67
So don't use traditional font lobes unless you need access to the index variable. 68
Finally Gendron briefer for loops over my nerves this is also recommended by one off the two dull items 69
that will be discussed later. 70
And that's about it. 71
Thanks for listening and we'll continue learning more language basics in the next chapter. 72
So see you in the next chapter. 73
Thank you.