Friday, May 30, 2008

Tutorial: Declaring Boolean Variables

Tutorial: Declaring Boolean Variables

Now let's write a Visual Basic project based on the snippet of code. In this tutorial, you will have a chance to declare three boolean variables and assign them different values.

Load the Developer Studio and close the project workspace you created. Then open a new text file and type the following code into the text Editor Window.

public static void main (String arv[] {
// Declare the boolean.
boolean myBol1;

// Declare and assign the value to false.
boolean myBool2 = false

// Declare and assign the value to true,
boolean myBool3 = true ;

//Assign the first to false
myBool = false;

//Print out values
System.out.printIn ("the value if my Bool1 is " + myBool1);
System.out.printIn ("the value if my Bool2 is " + myBool2);
System.out.printIn ("the value if my Bool3 is " + myBool3);

}
}

Thursday, May 29, 2008

PPP Platform

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. Payerpost can also be a very effective platform for advertisers to drive traffic to their commercial websites for higher viewership and profit.

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 blog advertising website right now for more information!



Tuesday, May 27, 2008

Characters

The keyword char denotes the character data type. The char type is exactly like char in C/C++ with only the one major difference. The char type in Java stores its values using the 16 bit Unicode format.

The following is an example of a char. Notice that there are single quotation marks around the actual character. Then denotes that X is a character literal, which was described earlier.

char mychar = 'X';

Friday, May 9, 2008

Documentation Comments 2

Although the preceding program may be a little difficult to write, the documentation is easy. The documentation describes the purpose of the function and what the user needs to do to operate the program.

Visual J++ can then recover the notes into actual user documentation, in HTML/web page format when you compile your code. This HTML documentation can then be linked to your page, or can e invoked with Visual J++ by pressing the F1 key.

Documentation Comments

Java has introduced a special type of comment called a documentation or doc comment. These comments begin with /** and end with */. Documentation comments are used using the Visual J++ doc tool.

You can use documentation comments to comment th purpose and/or functionality of the current Java or program. The following is an example:

/**
Java Stuff is a program that does everything the user wants.
This program is consists of several components.

*/

Multiple Line Comments

You"ll often want to write a paragraph of comments and you won't want to mess with a // at the beginning of each line. To do this, Visual J++ allows multiple line comments (also callled the multiple-line comments) enclosed within /* and */, such as the following:

/*
Program Author: Chuck Wood
Program Title: JavaStuff.java
.
.
JP
*/

Single Line Comments

You use the double slash (//) to comment a single line or part of a line. Here are some examples of single line comments:

//This is a full line comments. No other logic is allowed on this line.

1 = a + p; // All living things (1) consist of animals (a) and plants(p)

As you can see, // was used to add a line of comments.

Using Comments

Comments are important to every language. Good programmers place comments on any potentially ambiguous line of code. Others can use these comments to debug any cryptic code; you can even use them if you have return to your function after any length of time.

Comments in Visual J++ are similar to comments in C++, and are easy to implement. There are three types of comments: single line comments, multiple line comments and documentation comments.

Warning 2

Build the project by clicking on Build I build myIntegerTest to build the file. When prompted to create a default project workspace, click yes.

Execute the project by clicking on Build Execute. In the Dialog box that appears, type myInteger in the Class file nam field and click ok to continue. The following shows the DOS that opens with the output displayed

Monday, May 5, 2008

Warning

In the above code, just like in C/C+, the double backslash denotes a single line comment and the /'*I denotes multiline comments. (Please see the next section)

5. Save the text file by clicking on File1 Save. A Save As dialog box appears. Save this file as my IntegerTest.java in the msdev\projects directory on your system.

Sunday, May 4, 2008

Declaring Data Types 3

Notes on your code

Notice in the above code that you are declaring three integer data types: a byte called my Integer1, an int called myInteger2, and a long called myInteger 3. Then, you are using three lines of code, each containing printIn () to print out the values for eachof these variables.

Saturday, May 3, 2008

Declaring Data Types 2

3. Open a new text file in the Developer Studio by clicking on File1 New. On the dialog that appears, specify that you want to open a text file, and a fresh text file window appears, waiting for you to write you code.

4. In the Text Editor window, type your following code down starting with :
Class myIntegerTest {

Friday, May 2, 2008

Declaring Data Types

Let's go ahead and create a project in Visual J++, declaring various integer data types and assigning them values:

1. Make sure that you have Java J++ loaded.

2. If you still have the previous project from Chapter 1 open, you need to close it. Do this by clicking on File1 close workspace.

Thursday, May 1, 2008

Declaring Variable's Type

In Java, you must declare each variable’s type before you actually use them. To declare the variable type, all you have to do is to indicate the type and followed by the name of the variable. We call this process variable declaration. Variables are places where you store information. It is like a piggy bank where you put money in.