Friday, 2020-02-28 BioInfo Pakistan
Section categories
 JAVA Online Course [6]This Category Is To Support Our First Free Online JAVA Course.
 Our poll Pakistani Student Yes No Total of answers: 0
 Chat Box Only authorized users can post messages
 Statistics Total online: 1 Guests: 1 Users: 0
Home » 2011 » September » 2 » Lecture 1 Page 2
10:07 PM
Lecture 1 Page 2

 Move To Page 1Now Some Basic Examples1. Basic Data Types:   Every variable has some data type in JAVA, this data type decides what this variable will store. Some basic data types are as follows:String: As name describes it is used to store strings(Sequence of alphabets) in it. It is used as String s = "Its JAVA course";int: as name shows it stores integer value. It can't store decimal value e.g int a = 20;float and double: These two data types are used to store decimal values, difference in them is the usage of memory. More you will learn with time. It can be used as float x = 2.99;   2. Simple Program That Uses Strings:Make new project named StringTest as described before.Write following commands in main method.String x = "Java ";String y = "Course";String z = x+y;System.out.println(z);Test this and try different such statements.3. Simple Calculations:Make new project named BasicMaths as described before.Write following commands in main method.int a =12;int b =3;int c,d,e,f,g;c= a+b;d= a*b;e= a-b;f= a/b;g= a%b;System.out.println("Addition : "+ a +" + "+ b +" = "+ c );System.out.println("Multiplicaton : "+ a +" * "+ b +" = "+ d );System.out.println("Subtraction : "+ a +" - "+ b +" = "+ e );System.out.println("Division : "+ a +" / "+ b +" = "+ f );System.out.println("Remainder : "+ a +" % "+ b +" = "+ g );Test this and try different such statements.For Discussion I Will Be Online After 9 PM(Pakistan) Daily.You Can Also Leave A Thread At FORUM Which Will Be Answered In 24 Hrs.Your Assignment After This Lecture Is To Practice All These Tasks And Give Some New Examples At FORUM.Next Lecture Will Be On Tuesday.
Category: JAVA Online Course | Views: 809 | Added by: Ansari | Rating: 0.0/0