Friday, January 22, 2016

int primitiveData = 0;

In Java programming, Primitive Data is the most basic storage of data. Java is an Object oriented programming language, which means that most of the programming will be aimed towards and shaped around creating and modifying objects. The first step for that is Primitive Data.
There are several different ways to identify primitive data with variables. Java like every other programming language requires an IDE(Integrated Development Environment) which is any text editor and a Compiler such as Eclipse (http://www.eclipse.org/downloads/) to build and test programs, every IDE will need a copy of the Java Development Kit (JDK) (http://www.oracle.com/technetwork/java/javase/downloads) to access it download it and the IDE should automatically find it. I personally enjoy using Eclipse because as well as being a compiler it is also an IDE as well. Every line of code should be finished with a semicolon and any comment that you want to make shall be written with two forward slashes Ex: //This is a comment.
Different ways to identify variables in Java:
int (This identifies a variable to an integer or whole number. Ex: int x = 10; this will set variable x as an integer to the number 10, creating primitive data.)
boolean (This identifier will set a variable to either a true or false, the use of this is varied but it is mostly used for when a loop or a conditional requires a boolean, but is also not necessary at that point either. Ex: boolean end = false; <= Will set variable end to false)

For the next Identifiers you'll need to understand a basic concept of bit data, which means that a bit is a number in binary system (a 0 or 1), this makes up everything in programming, but it is unnoticeable. a byte is a gathering of 8 bits and everything is saved on bytes.
double (This identifier will set a variable to any rational number and can reach up to 64 bits or 8 bytes. Ex: double x1 = 10.32; It is also not necessary to always set an identifier with a number value as a number but you are also allowed to utilize operations such as x1 = 2.3 * 14; which will output 32.2, if an int is used for this same operation it will round to the nearest whole number it will set x1 to 32.)
float (This identifier will set a variable just like a double but is then used for different purposes, and is saved as 32 bits or 4 bytes.)

The next identifier deals with characters and it consequently called a char, a char identifier is used for single characters that can be typed on your keyboard. (Ex. char a = 'A'; to identify a char variable you have to type whichever character you want to assign the variable to inside single quotes.)
Strings: a string identifier is a special one because it is a combination of a seemly unlimited amount of char identifiers. It allows for an extensive use of characters. (Ex. String b = "This is String b :)";)
there are multiple special characters that you cannot use within strings but that will be talked about at a later time.

5 comments:

  1. thanks for that cesar java seems interesting!

    ReplyDelete
  2. Really wish i did my blog on this. Good idea! You did a good job at explaining the concepts too!!

    ReplyDelete
  3. Not gonna lie ceaser, this blog seems complex for me to understand. Regardless, as i read i can tell that you know what your talking about and the best part about this blog is how you elaborate and write about it. I can tell you enjoy learning about java. I hope that your readers enjoy and actually benefit from your instructions given in your blog. Good luck!

    ReplyDelete
  4. Java seems so simple when you explain it as such. You should become a college professor.

    ReplyDelete
  5. Java seems so simple when you explain it as such. You should become a college professor.

    ReplyDelete