One of the ways to manipulate a data type is to change the variable from one type to another. The form of conversion is known as casting. The actual syntax for casting between values is fairly simple. Put the data type you want to cast in front of the variable. as shown below.
int A;
char B;
A = (int)B;
The idea behind casting is very simple. However, there is a tricky part; you need to make sure that you understand all of the ins and outs of casting, because, if you are not careful, you could lose data during the cast. This is possible if the data type you are casting to is smaller than the orginal type.
Monday, June 9, 2008
Izea
Bloggers can now join a great program known as Payperpost to make some extra revenue just by blogging. It is a place that provides bloggers with the platform to earn some revenue at the comfort of their time/home. There are many offers that are available for bloggers to take up and they range from five to a whopping few hundred dollars!It all depends whether one’s blog is eligible for the offer and most importantly whether one managed to get the offer at the right time.Besides getting revenue from posting on your blogs or websites, there are also other sources of revenues such as paid to review, which allows bloggers to earn even more revenue.Payperpost portrays an energetic and pleasant image on its website that often gives people a refreshing and positive impression.
The features found on the website can be easily installed and the available opportunities are provided with clear guidelines of what the contents should be about.Basically, bloggers can feel free to write what they have in mind!If blogging is your interest and perhaps Payperpost will be a real deal for you while you are blogging. Besides getting offers from the market place where the offers are located, one can also have direct offers from the advertisers. This would mean another source of revenue for bloggers. Visit the get paid to blog website right now for more information!

The features found on the website can be easily installed and the available opportunities are provided with clear guidelines of what the contents should be about.Basically, bloggers can feel free to write what they have in mind!If blogging is your interest and perhaps Payperpost will be a real deal for you while you are blogging. Besides getting offers from the market place where the offers are located, one can also have direct offers from the advertisers. This would mean another source of revenue for bloggers. Visit the get paid to blog website right now for more information!
Thursday, June 5, 2008
E+3 : Notes
Scientific notation provides a shortcut way of representing a wide range of wide of numbers, but you lose some accuracy when you use it, because it does not allow for an extended amount of accurac. Numbers often are severed rounded when they are expressed in scientific notation.
Integers
Data types intger is declared as int. It is used to represent the integer data.
Floating point
Data types that contain decimal point are declared as float and long. These types usually provide single precision values respectively.
Characters
Data type that are symbols such as "a", "%". "$" are stored in variable declared as char.
Integers
Data types intger is declared as int. It is used to represent the integer data.
Floating point
Data types that contain decimal point are declared as float and long. These types usually provide single precision values respectively.
Characters
Data type that are symbols such as "a", "%". "$" are stored in variable declared as char.
Thursday, May 29, 2008
E+3 Part 2
To convert from scientific notion to regular number, take the number before the E (E stands for exponent) and multiply it by 10 to raised to the power after the + or – sign. For example 3.4E+38, you would do the following arithmetic.
1.4 X 10 power 38
Note
Scientic notation provides a shortcut way of representing a range of numbers, but you lose some accuracy when you use because it does not allow for an extended amount of accuracy.
1.4 X 10 power 38
Note
Scientic notation provides a shortcut way of representing a range of numbers, but you lose some accuracy when you use because it does not allow for an extended amount of accuracy.
Wednesday, May 28, 2008
Java’s Fundamental Data Type
What is E+3 all about?
For the floating point and long double data type, the range is usually expressed in scientific notion. The scientific notion is actually an easier way to represent decimal data. It would actually require 34 follow by 4931 to represent one extreme of the range. This would really eat up a great chunk of memory that we have!
For the floating point and long double data type, the range is usually expressed in scientific notion. The scientific notion is actually an easier way to represent decimal data. It would actually require 34 follow by 4931 to represent one extreme of the range. This would really eat up a great chunk of memory that we have!
Monday, May 26, 2008
Non-numerical Literals 2
In C, a string literal represents an array of characters (the char primitive data type). However, as you will learn soon, Java does not follow suit. The following code provides some examples of the use of a string literal and the \t escape characters:
“This is a test”
“This is V test”
The first line above simple prints out the statement “This is a test.” The second line prints out the same thing, but places a tab where the \t is so, when printed, it will look something like “ This is a \test.”
“This is a test”
“This is V test”
The first line above simple prints out the statement “This is a test.” The second line prints out the same thing, but places a tab where the \t is so, when printed, it will look something like “ This is a \test.”
Sunday, May 25, 2008
Non-Numerical Literals 2
\b Backspace
\f Form Feed
\n New line
\t Tab
\ Backslash
\’ Single quote
\” Double quote
You worked with string literal, the second major non-numerical literals, to print statements on the screen in the example in the last chapter. String literals are merely collections of character literals. Java stores string literals in a more complex type known as string object.
\f Form Feed
\n New line
\t Tab
\ Backslash
\’ Single quote
\” Double quote
You worked with string literal, the second major non-numerical literals, to print statements on the screen in the example in the last chapter. String literals are merely collections of character literals. Java stores string literals in a more complex type known as string object.
Friday, May 23, 2008
Non-Numerical Literals
Non-Numerical Literals
There are two major non-numerical literals in Java. The first, a character literal, represents a single character surrounded by quotations. Some characters are not so obvious or simply cannot be encased in quotations. That is where character escapes come in. The following post is a list of commonly used escape characters to print the not-so –obvious values:
There are two major non-numerical literals in Java. The first, a character literal, represents a single character surrounded by quotations. Some characters are not so obvious or simply cannot be encased in quotations. That is where character escapes come in. The following post is a list of commonly used escape characters to print the not-so –obvious values:
Tuesday, May 20, 2008
Literals Notes 2
Literals Notes 2
Floating-point types also let you specify scientific notation by using the letter e or (E) to represent the exponential power. For example, the value 2.54 x 10 power 5 represented in Java is 2.54e5 or 2.54e5f housed in the float type.
Unlike C and C ++, Java has Booleans literals, Java Booleans represent either the non-numerical value true or false.
Floating-point types also let you specify scientific notation by using the letter e or (E) to represent the exponential power. For example, the value 2.54 x 10 power 5 represented in Java is 2.54e5 or 2.54e5f housed in the float type.
Unlike C and C ++, Java has Booleans literals, Java Booleans represent either the non-numerical value true or false.
Monday, May 19, 2008
Literals Notes
Appended letters for specifying a particular data type when using literals are not case sensitive. For example, 100001 and 10000L both specify this literal to be a numerical type long. Extremely large values utilize the integer data type long. Floating-point values are automatically assumed to be a type double. However if you wish to use the smaller floating-point type float, then you need to append a letter “f” to represent that data type 2.313f.
Sunday, May 18, 2008
Numerical Literals
In Java programs, numerical literals represent quantitative values, Java supports several different numerical systems, including octal (a numbering system with a base of 8) and hexadecimal (using a base of 16). If needed, you can specify the literal to be long by appending the letter “L”: 24050000L. An int is the default type used for integer literals.
Thursday, May 15, 2008
Literal 2
Literal 2
Data types, discussed later in the chapter are values (a.k.a variables) that represent or hold other values. This is very similar to algebra, where x can be more than just x; x could be 2, square root of -5, or the gross national product. As you will learn later, Java has a specific set of data types for certain values.
Data types, discussed later in the chapter are values (a.k.a variables) that represent or hold other values. This is very similar to algebra, where x can be more than just x; x could be 2, square root of -5, or the gross national product. As you will learn later, Java has a specific set of data types for certain values.
Monday, May 12, 2008
Literal
Literal
A literal is any value expressed as itself. There are several types of literals; numerical literals, including integers, floating-point values, and Booleans; and non-numerical literals, including characters and multiple literals (known as string literals).
A literal is any value expressed as itself. There are several types of literals; numerical literals, including integers, floating-point values, and Booleans; and non-numerical literals, including characters and multiple literals (known as string literals).
Sunday, May 11, 2008
Getting A First Sip In Java
For a moment, let’s leave the theoretical world behind and get our hands dirty with Visual J++ by creating a very simple Java program in Visual J++.
To create any program in Visual J++, follow these 3 simple steps:
Write the program. (Later on you will learn tips and tricks to let Visual J++ write parts of your programs for you.)
Compile or build the code into an executable format.
Execute program.
To create any program in Visual J++, follow these 3 simple steps:
Write the program. (Later on you will learn tips and tricks to let Visual J++ write parts of your programs for you.)
Compile or build the code into an executable format.
Execute program.
Tuesday, April 29, 2008
Welcome
This is the advance Java website. Do look around for source for more information. Enjoy!
Josh
Josh
Subscribe to:
Comments (Atom)