Archive for January, 2011

Tutorial Java – #7 Reference data type variables

In this post it is described one of the most important concepts of Object Oriented Programming: Every class instance, object, is managed only by reference type variables (for those who know also C++, you could remember that in C++ this rule is not entirely true because objects are also managed by value type variables).

This rule is very important to understand because it’s a fundamental fact on which Object Oriented Programming languages (also C#) have been defined. Understanding it, will help you understand and learn Java programming. Read the rest of this entry »


J2ME tutorial – How to create a simple MIDlet application with NetBeans

The purpose of this tutorial is to present the basic elements needed for mobile Java applications (MIDlets) development. The notions described will be sufficient to build a simple application J2ME HelloWorld application.

Read the rest of this entry »


Tutorial Java – #6 Classes and objects

Classes represent the basic principles of object-oriented programming. Classes are abstract concepts, stories, blueprints, describing:

  • characteristics, attributes of an object; these represent what the object knows, what it is;
  • object methods; these represent what the object knows to do, its behavior;

Based on classes, the programmer can define something concrete, objects. Thus, by instantiating the class (attributes defined in class are initialized with values) are obtained object type variables. For those who have C programming knowledge, a class can be considered a structure defined by struct, in which you can define also methods.

Read the rest of this entry »

1 Comment

Tutorial Java 6 – #5 Flow control statements

In this post we can see how to implement in Java, the basic flow control structures / statements:

  • decision-making structures: if – then, if – then – else, switch;
  • structures for loop blocks: do-while, while – do, enhanced – for;
  • loop control instructions: break, continue;

Using control structures we can write programs for which the execution is not just a linear sequence of instructions.

Other topics that are part of this Java tutorial are accessible through Java 6 Tutorial – Contents.

Read the rest of this entry »

1 Comment

Tutorial Java 6 – #6 Clase si obiecte

Clasele reprezinta principiile de baza ale programarii orientate obiect. Clasele reprezinta notiuni abstracte, povesti, modele (blueprints), ce descriu:

  • caracteristicile, atributele unui obiect; reprezinta ceea ce stie sau ce este obiectul;
  • ce stie sa faca obiectul, comportamentul acestuia descris de metodele sale;

Pe baza claselor,programatorul poate defini ceva concret, obiecte. Astfel, prin instantierea clasei (atributele definite in clasa, sunt initializate cu valori) se obtin variabile de tip obiect. Pentru cei care au cunostinte de C, o clasa este asemenea unei structuri, definita prin struct, in care poti defini si metode.

Read the rest of this entry »

1 Comment

Tutorial Java 6 – #5 Structuri de control

In acest post vom vedea cum se implementeaza in Java, structurile de control fundamentale:

  • structuri decizionale: if – then, if – then – else,switch
  • structuri de ciclare  for, do-while,while – do, for imbunatatit (enhanced – for)
  • instructiuni de control: break, continue;

Prin intermediul structurilor de control putem scrie programe a caror executie nu inseamna doar o secventa liniara de instructiuni.

Read the rest of this entry »

1 Comment