Monday, August 31, 2009

CONSTRUCTOR -> is a method that has the same name as the class name, used to initialize the fields in the object, do not return a value, not even using the void, can be 'overloaded Constructros' (constructor that can initialize another object of the 1 way).
The example constructor program

image below is a continuation of the above programs. If you want to see the picture more details, please click on the image to the two

It is the pattern of existing constructors in java programs. This is only a small part of other programs.

Saturday, August 29, 2009

Command or task means employment that must be carried out, learn java program will discuss some of the methods used by a programmer in a command and call if she needed. In this case the method given in words or simple phrases in order to facilitate the call.
The method is an order or a task that is called by the calling method, and there are methods that call himself.

METHOD -> Method is a command or specific tasks are called by the calling method (CALLER) and the results returned back to the calling method.
Common form or in the method declaration:
return-value-type method-name (parameter-list)
(
declarations and statements
)

method declaration information
* return-value-type is the type of data from the results that will be returned to the calling method.
* method-name is the name for a method.
* parameter-list is a list of parameter types and names.
* declarations and statements are information provided by the method.

Scope of the method declaration
* methods that served to change the value of the object into the given prefix set, for example setJariJari (). Name the method after the same set of data objects of variable names to be changed in value.
* method in charge to take the value of the object given the prefix get, for example getLuas (). Name the method after the word get together with a variable data object to be known values.
* methods in addition to serving as number 1 and 2 above will be named in accordance with the tasks undertaken by these methods.

The examples of methods of program

learn java in the program this time related to the recursive method and overloaded methods.

RECURSION -> (recursive method) -> recursive method is the method to call himself
The examples of recursive methods (calculating factorial)


METHOD OVERLOAD -> Some of the methods with the same name but different parameters (in terms of quantity, and type of parameters). When overloaded method is called java compiler will search for the parameters of which match the arguments of the calling method.
The examples of methods overload program

Friday, August 28, 2009

2-dimensional array is a continuation of the 1-dimensional array in which the 2-dimensional array is a solution to resolve the java program error that can not be done with a 1-dimensional array is.

2 DIMENSIONAL ARRAY-> Lots of things that can not be solved with a 1-dimensional array. Examples: for applications such as matrix-shaped table where the table of metrics are appointed by both rows and columns in filling or taking data matrix. Thus necessary to solve the problem of 2-dimensional array.
Syntax
Datatype[] [] name.var [= new daattype [number of rows] [number of coloums]];

Some ways to access the array variable
is a way that is used to fill, and retrieve data into an array variable.

* Fill the data into 2-dimensional array of variables is done by mentioning No.Rows and No.Coloums of the element to be filled.
Syntax
Name_var [no_Rows] [no_Coloums] = data

* Importing data from 2-dimensional array used by No.Rows and No.Coloums mention of the array, which aims to save kesebuah variable or to print.
Syntax
Name_var = name_var [no_Rows] [no_Coloums]

click the image below for details

this is the introduction of an array, which has some differences from the array 1 and array 2. java program starts from the simple.

Saturday, August 22, 2009

learn java program to introduce the class string buffer where the previous class are string, character and stringbuffer.
class stringbuffer introduce the concept adopted in the data-data, the pointer of char from the C / C + +. Where the pointer data type is the implementation of dynamic-allocation of the use of a large number of variables if necessary, and removal of a variable if it is not required again at run-time.

STRINGBUFFER CLASS -> Model second pointer is to adopt the concept of char from the C / C + +. Where the pointer data type is the implementation of dynamic-allocation of the use of a large number of variables if necessary, and removal of a variable if it is not required again at run-time.
StringBuffer initialization
Unlike the string class, that data can only be in stringbuffer initialisation through constructor namely using the "NEW" command.
StringBuffer abc = new StringBuffer ( "Budi Luhur University - Jakarta");

The Example Program Stringbuffer
may appear to use new, where the program stringbuffer class

Wednesday, August 19, 2009

introducing the next character class, character class that is handling a problem of data type character which method is used to manipulate the data.
Previously, the class is diverse, but here there is only the introduction of character classes.
to find out the more you can learn the class and the string class stringbuffer.

CHARACTER CLASS-> character class is used to improve a programmer's ability to handle data type character. Many of the methode prepares for manipulating character data. Starting from the type of check up to make a character conversion type data into character data.
Initialisation Data Characters
class provides a character konstruktor to the data character that is: with a character parameter data bertipe character.

example of the class character
character abc = new character ( 'R');

example program class character

Sunday, August 16, 2009

Then learn java program will continue to start Array is a variable declaration in the java program, which makes it easier for a programmer in a program.

ARRAY -> Array is a solution to declare a number of variable appropriately. Use an array of variables to save time pronouncing the name variable. Array variable is a number of variables with the same name.
Illustrasi Array:
Index data






notes
: No.Indeks / beginning No.Element number 0 (zero) and end n-1 where n = number of data.


DECLARE VARIABLE ARRAY
General form:
Data Type [] Variablename [= new datatype [number of elements]]

Some way declare an array variable:
1. Without mentioning some of the required number of elements
int [] numbers;
In the example above variable number can not be (fill in) before a number of elements or ordered before the reservation. So that should be written under the command like this:
number = new int [5];
2. With the number of elements that are required
int [] numbers = new int [5];
Keep in mind, how the above data is done manually with the input one-one.
3. With the automatic method
number of elements not explicitly shown can still be seen from the data that is defined sacara regularly.
int number = (3,5,7,1,10);

Calculating Number of Array Elements:
Java provides a function or method to calculate the number of elements that have a variable array in the function "length".
WRITING FORMAT AS NEXT
Name_Variable_ArrayLength

example
System.out.println ( "number of elements in the array variable is a number:" + number.length);
Sample Program initialisation-Element Array Element

Output or Results
notes : picture on the side of the program is the result of the above, where the above program using JCreator pro (JAVA)

Monday, August 10, 2009

OK .... now we will start again in learnjavaprogram. This time related to the keyword while. Keyword in the previous 2 while there are:
While and Do-While

WHILE -> the process of looping with a particular selection, where during the process of looping the loop true value will continue to run.
syntax









See above there is a (var_selection), a variable that will hold the selection in the loop when walking. During var_selection values is correct, then in block akan While the execution.
The Example Program WHILE


















Control Structure WHILE

DO-WHILE -> looping process used is at least 1 time the localization.
syntax










statement in the block Do-While dikerjakan first time, and after that selection occurs in the keyword while. TRUE if the statement will then be reset, otherwise if FALSE exit from the loop.
The Example Program DO-While


























Control Structure DO-While

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Macys Printable Coupons