what are integer literals & where can they come in handy
so i was reading the article about primitive data types and i came across litterals. so i understand the uses of the 8 primative types but i dont understand why you would do this below
float pi = 3.1415F;
long pi2 = 3141L;
does adding the extra 'F' / 'L' onto the value do anything ? i have been struggling to find infomation that I understand. also where would i use these in a program. thanks, hope you understand what im trying to get at :S massive learninng curve, SO MUCH TO LEARN !!
if there are any articles you could link me to that would be great, just trying to save you time on explaining.
Re: what are integer literals & where can they come in handy
Literals are constant piece of data and it tells the data type and value. Here are a few examples of literals:
Notice how writing them differently is important. Here's the 1st part of a video series that gives a pretty comprehensive explanation of literals and data types: Java Tutorial 1.1 Primitives & Literals - YouTube