Archive for December, 2010

Tutorial Java 6 – #4.3 Matrixes and Multidimensional Arrays

In this post we will see what are and how to define multidimensional arrays. The most common multidimensional array is the matrix – a two dimension array. Despite the fact in our mind a two-dimension array is like a table, a matrix is in Java an array of arrays, like in this image (a two-dimension array with 3 columns and 3 lines):
Read the rest of this entry »

,

2 Comments

Tutorial Java 6 – #4 Arrays

In this topic we will see how we define and process arrays data structures in Java.

An array is a particular form of Java object that is used to store a homogeneous list of elements (each element of the vector has the same type as vector type – the base type). The number of elements in the array is fixed and it defines its length.

Read the rest of this entry »

,

4 Comments

Tutorial Java – # 4.1 How to add a new element to a Java array

In this post we see what is the solution to the problem of adding a new element to an existing array. As we saw in the Java Tutorial 6 – #4 Arrays, arrays are objects which manage a homogeneous and compact list of items.

Because the list of elements is a compact memory area in Heap, the answer to the question of how we add a new element is that it is NOT possible. Once constructed the array, with a finite number of elements, the space it occupies can not be resized.

Read the rest of this entry »

,

4 Comments

Tutorial Java 6 – #4.2 How to copy values of an array into another array

In this post are described the methods used to copy one array values into another array. Do not forget that arrays are objects in Java ( Java Tutorial 6 – #4 Arrys ) which means that the array variable that manage the collection of values is a reference, a pointer, which contains the address of the first element of the array.

Read the rest of this entry »

3 Comments

How to encrypt / decrypt with AES from Bouncy Castle API in J2ME applications

In this post we will see how to use the AES (Advanced Encryption Standard) or Rijndael algorithm implementation from the Bouncy Castle API for J2ME platform. The example will use the AES lightweight engine to encrypt and decrypt a file managed by a J2ME (Midlet) application.

The Bouncy Castle Crypto API for Java provides a lightweight cryptographic API that works with everything from the J2ME to the JDK 1.6 platform.

The API is different for J2ME platform than the one for JDK platform. For example, the lightweight API has different implementations for the two platforms:

Read the rest of this entry »

, , , ,

19 Comments

Tutorial Java – #4.2 Cum se copiaza in Java elementele unui vector in alt vector

In acest post sunt descrise modalitatile prin care se poate copia un vector in alt vector, la nivel de valori. Nu trebuie uitat faptul ca vectorii reprezinta in Java obiecte (Tutorial Java 6 – #4 Vectori) ceea ce inseamna ca numele vectorului, variabila prin care gestionam colectia de valori, este o referinta, un pointer, ce contine adresa primului element din vector.

Read the rest of this entry »

,

2 Comments

Tutorial Java – #4.1 Cum se adauga in Java un element nou la un vector existent

In acest post vedem care este solutia la problema adaugarii unui element nou la un vector existent. Asa cum am vazut in Tutorial Java 6 – #4 Vectori, vectorii reprezinta obiecte prin care se gestioneaza o lista compacta de elemente omogene.

Read the rest of this entry »

2 Comments

Tutorial Java 6 – #4 Vectori

In acest topic vom vedea cum definim si cum prelucram structuri de date de tip vector sau matrice in Java.

Un vector reprezinta in Java o forma particulara de obiect ce este utilizat pentru a stoca o lista de elemente omogene (fiecare element din vector are acelasi tip ca si tipul vectorului – tip de baza). Numarul de elemente din vector este fix si defineste lungimea acestuia.

, ,

3 Comments

Tutorial Java 6 – #2.1 How to write or generate JavaDoc comments

In software programming it is important to document the source code, because:

  • you will have a clear picture of complex Java projects with many classes or modules;
  • you will be able, later, to understand what was done so that you can modify, add or delete it.

For Java applications, documentation is usually supplied in HTML format in the form of archives or .chm files. For an efficient source code documentation , JavaDoc projects are generated automatically based on source code comments with a JDK (Java Development Kit) tool, javadoc.exe.

Read the rest of this entry »

1 Comment

Tutorial Java 6 – #2.2 How to generate JavaDoc in Eclipse or NetBeans

Java source code documentation is represented by JavaDoc projects, which are a collection of HTML pages describing the classes and methods in the code. To generate Javadoc documentation you need a tool from the JDK, javadoc.exe , and comments in the source code written according to strict rules (  ). Because it is more efficient to develop Java projects in a IDE (Integrated Development Environment) as NetBeans or Eclipse , JavaDoc documentation can be automatically generated in all of these development environments.

Read the rest of this entry »

, ,

1 Comment