Integer- Is a data type that will the mathematical workings out that is a whole number.Integer means maths of a whole number.This will mean that you will use in the mathematics sums that you will do in Java and this will define that something is a whole number.The benefits of using integers is that your work would stay organised as you can see clearly where you define the value.
public static void main(String[] args) {
int iPass = 10; //This is showing that int=iPass so i pass is an integer and the value of iPass is 10
int iMerit = 15; //iMerit is an integer and it is worth 15
int iDistinction = 20; //iDistinction is an integer and it is worth 20
Boolean- Boolean will create a truth or false statement in the programming language your are using.This will help with things such as a truth or false quiz or something like a question with a yes or no answer for example "Are you 21?" there would only be two outcomes to this question and they would be yes and no or true or false.The benefits of using a Boolean is that you can create a statement where you can find out a true or false answer
This is checking the value of the check cell.The if and else is allowing it to become the boolean.
String-String is the data type that will allow you to write with letters.when you use string you will have to put them in quotation marks so that they will print them.The benefit of using a string is that it will allow you to create text on a page for example like a report.
public class HumanBeing {
String sName; //This coding is showing that the value of sOrigin is a string and this means the value is letters.
char cSex; //This line of coding is showing that cSex is equal to characters
String sOrigin; //Value is string which means you can write with characters
double dHeight;//The value of height is measured by numbers and this measured by double
double dWeight;//the value is measured by double so it will measure by numbers
String sSkinColour; //The string will find the value of the letters
Double-Double is like an integer because it was to do with maths but double is for the larger number which will deal with huge numbers.The benfit of using a double is that you can work out mathematical problems with large numbers quickly.
public class HumanBeing {
String sName; //This coding is showing that the value of sOrigin is a string and this means the value is letters.
char cSex; //This line of coding is showing that cSex is equal to characters
String sOrigin; //Value is string which means you can write with characters
double dHeight;//The value of height is measured by numbers and this measured by double
Char-char is another data type that is just like string data type.It will hold a single character and like string you will also need to put the text in speech marks'a'.The benefit of using a char is that you can define a letter, which will be effective to the make it stand out.
public class HumanBeing {
String sName; //This coding is showing that the value of sOrigin is a string and this means the value is letters.
char cSex; //This line of coding is showing that cSex is equal to characters
Float- Float is a data type that will move something such as text or an image, to a left or right however it will not go up or down.The benefit of using a float is that you will be able to move an image or something that you will need to and this will be able to space out the page that you are creating.
float:left; /*Float will allow whatever you are moving to the left or to the right however you will not be able to move things up or down and this will also allow other things to wrap around the object you are using the float with. They are also very useful for moving images.*/
No comments:
Post a Comment