You are on page 1of 16

 A data type is a classification of a particular type of information that is built in feature in Java. .

Type Boolean Byte Char Double Float Int Long Short Stores data in only of two states. Store numbers with up to 6 or 7 decimals as floating point values Stores whole number values in 32 bit Stores whole number values in 64 bit Stores whole number values in 16 bit . floating point values. as logical value of true or false Stores whole number values in 8 bit signed locations from -128 to + 127 Stores any one of the 65. 436 single characters Stores numbers with up to 14 to 15 decimal places or double precision.

 A variable has a data type and a name.  <data type> <name> [=initial value]. The data indicates the type of value that the variable can hold.  .A variable is an item data used to store state of objects.

An identifier is a word that the programmers chooses to label a storage address in memory.  A constant is a value that does not change during the course of the program.  › pi .

cents Sales& ax 7123 Explanation numberOfPeo ple public .LEGAL firstName first_Name employee7 $amount totalSales invNo123 ILLEGAL First Name 7employee $amnt.

.

0/3.0 RESULT 23 17 60 6 6.OPERATOR + * / / DESCRIPTION Addition Subtraction Multiplication Division Division with floating point numbers Modular Division EXAMPLE 20+3 20-3 20*3 20/3 20.6666667 % 20 % 3 2 .

OPERATOR < > <= >= DESCRIPTION Less than Greater than Less than or equal to Greater than or equal to TRUE EXPRESSION (2<9) (5>1) (3<=4) (8>=6) FALSE EXPRESSION (9<2) (1>5) (5<=4) (3>=7) == != Equal to Not equal to (9==9) (4!=2) (5==9) (2!=2) .

evaluates to the value of op after it was incremented Decrements op by 1. evaluates to the value of op before it was incremented Increments op by 1. evaluates to the value of op after it was incremented ++ ++op -- op-- -- --op .Operator ++ Use op++ Increments op by 1. evaluates to the value of op before it was decremented Decrements op by 1.

. The expected output is. Let the values of the three numbers be 10. › Number2 = 20. Create a program that outputs the average of three numbers.and 45. › Number3 = 45. › Number1 = 10. › Average is = 25.20.

entering data. . and viewing results. Interactive is the term used with programs that allows the user to interact with program by making choices.

used for prompts and errors message readLine() Keyboard Buffer System.CLASS System.out Monitor System.in Function Accepts data from the keyboard buffer wrapped in the InputStreamReader Send output to the display or redirects to a designed file Sends output to the monitor.err Monitor .

classes to facilitates graphics user interface. vectors and others .io java. Classes to facilitate input and output Classes used for dates.applet Java.Package Name Java.awt Java.util Description Classes to facilitate using applets Abstract Window Toolkit.

 Create a program that will accept three unique numbers and display the sum of three numbers. .