Java Tutorial

by Dinesh Thakur Category: Data Type
  1. When the variable is declared within the method, block and constructor then the variable is treated as local variable.
  2. Local variable must be initialized before you call it otherwise it generates compile time error.
  3. Same local variable can be declared in two different blocks.
  4. Local variable never use any access specifier. It only takes the default access specifier.
  5. Local variable can never be declared through any access specifier except default access specifier.
 
by Dinesh Thakur Category: Data Type

The final modifier indicates that an object is fixed and cannot be changed. When we use this modifier at a class level, it means that the class can never have subclasses. When we apply this modifier to a method, the method can never be overridden. When we apply this modifier to a variable, the value of the variable remains constant. We will get a compile-time error if we try to override a final method or class. We will also get a compile-time error if we try to change the value of a final variable.

 
by Dinesh Thakur Category: Data Type

A computer cannot store characters or integers. Computer can store information in the form of bits and bytes. The bit is a basic unit of information in computer. A bit can only have two values: yes or no, true or false, 1 or 0.



 
by Dinesh Thakur Category: Operators and Expressions

Constants :- Constants in java are fixed values those are not changed during the Execution of program java supports several types of Constants  those are  



 
by Dinesh Thakur Category: Operators and Expressions

An operator is a symbol which helps the user to command the computer to do a certain mathematical or logical manipulations. Operators are used in Java language program to operate on data and variables. Java has a rich set of operators which can be classified as



 
by Dinesh Thakur Category: Operators and Expressions

Identifiers :- The Identifiers are those which are used for giving a name to a variable  ,class and method ,packages ,interfaces etc There Are Some Rules against for using the Identifiers

 
by Dinesh Thakur Category: Operators and Expressions

The left-shift, right-shift, and zero-fill-right-shift operators <<, >>, and >>> shift the individual bits of an integer by a specified integer amount.

 
by Dinesh Thakur Category: Operators and Expressions

Logical operators are used to combine one or more relational expressions that results in formation of complex expressions known as logical expressions. Like relational operators, the logical operators evaluate the result of logical expression in terms of Boolean values that can only be true or false according to the result of the logical expression.

 
by Dinesh Thakur Category: Operators and Expressions

The assignment operator (=) is the most commonly used binary operator in Java. It evaluates the operand on the tight hand side and then assigns the resulting value to a variable on the left hand side. The right operand can be a variable, constant, function call or expression. The type of right operand must be type compatible with the left operand. The general form of representing assignment operator is

 
by Dinesh Thakur Category: Operators and Expressions

Conditional operator (?:) is the only ternary operator available in Java which operates on three operands. The symbol "?" placed between the first and the second operand , and " : " is inserted between the second and third operand. The first operand (or expression) must be a boolean . The conditional operator together with operands form a conditional expression which takes the following form.

 
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content