Java M1
Java M1
Prepared By:
Dinesh S
Dept of AI&ML
Furthermore, when a variable is initialized, the type of the initializer must be the same as (or
convertible to) the declared type of the variable.
Thus, in principle, it would not be necessary to specify an explicit type for an initialized variable
because it could be inferred by the type of its initializer.
Of course, in the past, such inference was not supported, and all variables required an explicitly
declared type, whether they were initialized or not.
if
Jump Statements
Java supports three jump statements:
break,
continue,
and return.
Using break
Introducing Classes
It is the logical construct upon which the entire Java language is built
because it defines the shape and nature of an object.
As such, the class forms the basis for object-oriented programming in Java.