Search Java Tutorials

Custom Search

What You Will Want to Complete This Tutorial?

You must have at least 1st and 2nd pre-requirements to start the tute. Other requirements will require for last chapters only. These all are free to use and download!
  1. Java Development Kit Standard Edition (JDK / J2SE) Any Version(www.java.com)
  2. Any Text Editor (Note Pad quite enough or get Notepad++ from (http://notepad-plus.sourceforge.net)
  3. Java Run Time Environment (JRE) Any Version(www.java.com)
  4. Java Enterprise Edition (J2EE) for advanced developing (For last few chapters)(www.java.com)
  5. Java Wireless Toolkit for Mobile Application Development (For Mobile Application Development Chapters) (www.java.com)
  6. Tomcat Web Server to run Servlets. (www.tomcat.apache.org/)
Your operating system may be any version of Windows.
What will you learn (As a summary)?
  1. How to build console and windowed applications using Java
  2. How to build web page elements with Java Applets
  3. How to build Database Programs with Java
  4. How to build enterprise applications with Beans
  5. How to add Email functions to Java programs
  6. How to program smart devices (Phone, PDA etc…) with Java

Java Operators and Concatenation

An operator is a symbol that tells the computer to perform a vertain mathematical or logical manipulation. Values used by an operator are known as operands.

There’re arithmetic and comparison operators.

Integer Arithmetic Operators

Description

Example

+

Addition

1 + 2 = 3

-

Subtraction

12 – 2 = 10

*

Multiplication

10 * 3 = 30

/

Division

100 / 4 = 25

%

Modulus (Reminder)

3 % 2 = 1

Comparison Operators

Description

Example

Returns True

Returns False

<

Less than

2 <>

100 <>

>

Greater than

500 > 1

1 > 500

==

Equal to

1 == 1

1 == 2

<=

Less than or equal

1 <= 1 , 0.5 <= 1

2 <= 1

>=

Greater than or equal

50 >= 50 , 100 >= 50

1 >= 2

!=

Not equal

1 != 2

1 != 1

Other than this “=” operator known as assignment operator. It can be used within mathematical sums and also to assign values to variables.

Escape sequence

You can use escape sequences within literal strings to format text.

Escape Sequence

Description

\b

Back Space

\t

Tab

\n

New Line or line feed

\f

Form feed

\r

Carriage return

\”

Double quotation mark

\’

Single quotation mark

\\

Backslash


Increment, Decrement operators

You can use operators like +, - as follows.

Ex:

++ adds one to value in variable x. And then print it (Prefix).

Ex:

Computer prints the value in x and then adds 1 to value in x (Postfix).

You can use -- same way.

Concatenation

Joining strings with other data types within a single statement is known as: Concatenation”.

Ex:

‘+’ sign is also known as “Concatenating operator”. Above example concatenate a literal string “Value in x is:” with value in x which is an integer.

No comments: