Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Colombo
YEYE 3 in 1 Instant Coffee Mix 50 Sachet
Romeshka
Updated:
Yesterday at 12:16 AM
Colombo
Red Hat Certified System Administrator (RHCSA) - RHEL 10
Sanjeewani95
Updated:
Friday at 7:43 PM
NURSING , CAREGIVER , HOTEL & BEAUTY COURSES
IVA Para Medical Campus
Updated:
Jul 2, 2026
Handmade Character Soft Toys Peppa Pig Family
anil1961
Updated:
Jul 1, 2026
Ad icon
Video Content Creator
pramukag
Updated:
Jun 28, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
Java Lesson-1.0.1.4
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="ravicplk" data-source="post: 2084312" data-attributes="member: 54446"><p><strong>Hello there..how is everything going fine? Ready for the lesson? Then lets get started.</strong></p><p><strong>So before we move on to the Practical lesson lets check out those data types in detail.</strong></p><p><strong></strong></p><p><strong>First lets peek in to integer group,</strong></p><p><strong></strong></p><p><strong>In the integer group there are four data types.</strong></p><p><strong></strong></p><p><strong>What are they?</strong></p><p><strong></strong></p><p><strong>Byte,short,int,long.</strong></p><p><strong>I know u are having a question in ur mind nee.? Why the hell that there are four data types to represent whole numbers.</strong></p><p><strong>The reason is this. When u want to use whole numbers in various ranges, u have to move to different data types. </strong></p><p></p><p><img src="http://img375.imageshack.us/img375/4633/java2ix7.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><strong>So now I think u know why we have to use four data types when u want to use integers in a program. If u want to use a big number u have to use long and like that u have to choose the best data type for u r need. And very importantly u have to think about the bit width too. If u want to store a number such as 12 choosing long wont be a good idea. coz it has a bit width of 64. its really long and takes up more memory. So u have to think about the memory allocation too,</strong></p><p><strong></strong></p><p><strong>Next one, the floating-point group, so what are the data types in that group. As u can remember two data types are there. “double” and “float”.</strong></p><p><strong>Another table coming up..</strong></p><p></p><p><img src="http://img375.imageshack.us/img375/6708/java3nk5.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><strong>So I think no need to explain this, similarly to the integers u have to choose the best one for u r work considering the memory allocation and also u have to think about the range as well.</strong></p><p><strong>Actually a double can hold real numbers </strong></p><p><strong>±4.94065645841246544e-324d to </strong></p><p><strong>±1.79769313486231570e+308d</strong></p><p><strong></strong></p><p><strong>And a float can hold</strong></p><p><strong>±1.40129846432481707e-45 to </strong></p><p><strong>±3.40282346638528860e+38</strong></p><p><strong>Hmm that’s quite a bit of numbers there, I am having a headache just seen them.</strong></p><p><strong></strong></p><p><strong>Ok now. We have a group called character and the relevant data type is “char”</strong></p><p><strong>Char is used to store characters in a java program. Characters can be numbers,letters and etc.. I like to mention something I have read from a book. if someone have done C or C++ before they might familiar with “char” before. But guys don’t mess up. Coz the char in a C\C++ is not similar to char in java.</strong></p><p><strong>In C\C++ char is an integer type that is 8bits wide. But in java ,it uses Unicode to represent characters.(Unicode defines a fully international character set and this can represent characters from all most all the human languages). To do this Unicode needs a bit width of 16. So it is different from C and C++. That is an additional thing ok.</strong></p><p><strong></strong></p><p><strong>Now next one, Boolean group. In the Boolean group u have “boolean” data type. Actually what is boolean. He heeeeeee… a word with seven letters. That is also true. Actually boolean is used to interact with the logical values. It can only one logical value from two possible logical values.</strong></p><p><strong>As an example take a look at the statement given below,</strong></p><p><strong>“I will pass the exam” (will I???) ok now there can be only one result which can br happened out of two possible results.</strong></p><p><strong>First one this statement can be true. And also can be false. But only one can be happened. If I pass this is true and if I fail this becomes false. So it is like that, only two values in boolean operations. “True” and “False” </strong></p><p><strong></strong></p><p><strong>So that is a detailed description about data types in java. Now u have to do a small exercise to get familiar with these data types.</strong></p><p><strong>Here is the code.</strong></p><p></p><p><span style="font-size: 15px"><strong>class example</strong></span></p><p><span style="font-size: 15px"><strong>{</strong></span></p><p><span style="font-size: 15px"><strong>public static void main(String args[])</strong></span></p><p><span style="font-size: 15px"><strong>{</strong></span></p><p><span style="font-size: 15px"><strong>byte a=12;</strong></span></p><p><span style="font-size: 15px"><strong>short b=1234;</strong></span></p><p><span style="font-size: 15px"><strong>int c=14256;</strong></span></p><p><span style="font-size: 15px"><strong>long d=235678;</strong></span></p><p><span style="font-size: 15px"><strong>float e=12.34f;</strong></span></p><p><span style="font-size: 15px"><strong>double f=123.43;</strong></span></p><p><span style="font-size: 15px"><strong>boolean g=true;</strong></span></p><p><span style="font-size: 15px"><strong>char h='y';</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(a);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(b);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(c);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(d);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(e);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(f);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(g);</strong></span></p><p><span style="font-size: 15px"><strong></strong></span></p><p><span style="font-size: 15px"><strong>System.out.println(h);</strong></span></p><p><span style="font-size: 15px"><strong>}</strong></span></p><p><span style="font-size: 15px"><strong>}</strong></span></p><p></p><p><strong>And for u r convenience I made a screen video (thanks for malinga ayya for the software)</strong></p><p><strong>So that is today’s lesson. Got to go now, c ya later.</strong></p></blockquote><p></p>
[QUOTE="ravicplk, post: 2084312, member: 54446"] [B]Hello there..how is everything going fine? Ready for the lesson? Then lets get started. So before we move on to the Practical lesson lets check out those data types in detail. First lets peek in to integer group, In the integer group there are four data types. What are they? Byte,short,int,long. I know u are having a question in ur mind nee.? Why the hell that there are four data types to represent whole numbers. The reason is this. When u want to use whole numbers in various ranges, u have to move to different data types. [/B] [IMG]http://img375.imageshack.us/img375/4633/java2ix7.jpg[/IMG] [B]So now I think u know why we have to use four data types when u want to use integers in a program. If u want to use a big number u have to use long and like that u have to choose the best data type for u r need. And very importantly u have to think about the bit width too. If u want to store a number such as 12 choosing long wont be a good idea. coz it has a bit width of 64. its really long and takes up more memory. So u have to think about the memory allocation too, Next one, the floating-point group, so what are the data types in that group. As u can remember two data types are there. “double” and “float”. Another table coming up..[/B] [IMG]http://img375.imageshack.us/img375/6708/java3nk5.jpg[/IMG] [B]So I think no need to explain this, similarly to the integers u have to choose the best one for u r work considering the memory allocation and also u have to think about the range as well. Actually a double can hold real numbers ±4.94065645841246544e-324d to ±1.79769313486231570e+308d And a float can hold ±1.40129846432481707e-45 to ±3.40282346638528860e+38 Hmm that’s quite a bit of numbers there, I am having a headache just seen them.[/B] [B] Ok now. We have a group called character and the relevant data type is “char” Char is used to store characters in a java program. Characters can be numbers,letters and etc.. I like to mention something I have read from a book. if someone have done C or C++ before they might familiar with “char” before. But guys don’t mess up. Coz the char in a C\C++ is not similar to char in java. In C\C++ char is an integer type that is 8bits wide. But in java ,it uses Unicode to represent characters.(Unicode defines a fully international character set and this can represent characters from all most all the human languages). To do this Unicode needs a bit width of 16. So it is different from C and C++. That is an additional thing ok. Now next one, Boolean group. In the Boolean group u have “boolean” data type. Actually what is boolean. He heeeeeee… a word with seven letters. That is also true. Actually boolean is used to interact with the logical values. It can only one logical value from two possible logical values. As an example take a look at the statement given below, “I will pass the exam” (will I???) ok now there can be only one result which can br happened out of two possible results. First one this statement can be true. And also can be false. But only one can be happened. If I pass this is true and if I fail this becomes false. So it is like that, only two values in boolean operations. “True” and “False” So that is a detailed description about data types in java. Now u have to do a small exercise to get familiar with these data types. Here is the code.[/B] [SIZE="4"][B]class example { public static void main(String args[]) { byte a=12; short b=1234; int c=14256; long d=235678; float e=12.34f; double f=123.43; boolean g=true; char h='y'; System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d); System.out.println(e); System.out.println(f); System.out.println(g); System.out.println(h); } }[/B][/SIZE] [B]And for u r convenience I made a screen video (thanks for malinga ayya for the software) So that is today’s lesson. Got to go now, c ya later.[/B] [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom