Archive for februarie, 2011

Tutorial Java SCJP – #13 Pachete si modificatori de acces pentru clase

Doua concepte importante ale Programarii Orientate Obiect impun separarea entitatilor (claselor) pe baza functionalitatii sau semnificatiei lor (modularizare) si ascunderea datelor si comportamentului în cadrul unei clase (încapsulare). Pentru a atinge aceste obiective se folosesc clase pentru a defini entitati care au atribute si un comportament (metodele lor). La un nivel superior, pentru o buna organizare a modulelor aplicatiei Java puteti utiliza pachete (packeges) pentru a separa modulele realizate de programatori diferiti sau pentru a grupa clasele în module in functie de utilitate, functie, logica.

Read the rest of this entry »

,

1 Comment

Tutorial Java SCJP – #13 Packages and Class access modifiers

Two important concept of Object Oriented Programming is to separate entities based on their functionality or logic and to hide data and behavior within a class (encapsulation). For that you have classes used to define entities that have attributes and a behavior (their methods). At a higher level, for a good organization of the application modules you can use packages to separate the work of different programmers or to aggregate classes in modules based on their logic or utility.

Read the rest of this entry »

,

3 Comments

Service Pack 1 for Windows 7

Service Pack 1 for Windows 7 (and Windows Server 2008 R2) is now available. The update can be downloaded from here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c3202ce6-4056-4059-8a1b-3a9b77cdfdda&displaylang=en. It can be also downloaded via Windows Update.

No Comments

How to skip C++ access modifiers – not real code security

C++ is not a pure object oriented programming language (this topic is just another argument) but it is implementing OOP concepts. On of these concepts is encapsulation: the object hides its contents (attributes or instance variables) by making them private / protected and gives access to them through public methods (like getters and setters).

Read the rest of this entry »

, ,

No Comments

Tutorial SCJP Java – #11 Cum se utilizeaza String, StringBuilder si StringBuffer

In limbajele de programare, majoritatea tipurilor de date utilizate pentru variabile sunt valorile booleene, valorile numerice si sirurile de caractere (sau vectori de caractere terminati cu ‘\0’). In contrast cu C sau C++, in Java modul de gestiune a sirurilor de caractere este diferit, deoarece:

  • in Java fiecare char reprezinta o valoare Unicode pe 16 biti, si nu 1 octet;
  • in Java, valorile de tip siruri de caractere sunt gestionate de obiecte String;
  • in Java, sintaxa va permite sa utilizati String asemenea unui tip primitiv de date (puteti folosi operatorul = pentru a le initializa)
  • in Java, String sunt obiecte imuabile (immutable), in sensul ca odata ce sunt create, ele nu isi pot schimba valoarea.

Read the rest of this entry »

2 Comments

Tutorial SCJP Java – #12 Immutable: String si Integer

Obiecte immutable (imuabile) sunt obiecte care nu isi pot schimba valoarea, odata ce acestea sunt create. Obiectul immutable cel mai cunoscut in Java este String. In afara de String, exista si alte obiect imuabile, iar unul dintre acestea este Integer (clasa si nu tipul primitiv), care are un comportament interesant pentru valori intre -128 si 127. Read the rest of this entry »

3 Comments

Parteneriat Nokia – Windows (Windows Mobile 7)

Trebuie sa recunosc ca sunt putin socat de acest anunt. Chiar daca anuntul oficial a fost facut pe 11 Februarie 2011, azi am citit despre el (am fost in vacanta…). Incercand sa trec peste aceasta uimire, este ironic sa aflu acest lucru azi, dupa ce am sustinut mai devreme un seminar de Programare Dispozitivelor Mobile in care am facut o comparatie intre platformele .NET pentru Windows Mobile, J2ME – Java Micro Edition pentru Symbian si Java pentru Android. Evident, ordinea de prezentare anterioara este crescatoare in ceea ce priveste performanta, calitate, dezvoltare viitoare, etc.

Read the rest of this entry »

,

1 Comment

Tutorial Java SCJP – #12 Immutable, String and Integer

Immutable objects are objects that don’t change their value once they are created. The most known immutable object in Java is String. Besides String, there is another immutable object, and this is Integer (the class and not the primitive) which has an interesting behavior for values between -128 and 127 . Read the rest of this entry »

,

3 Comments

Tutorial Java SCJP – #11 How to use String, StringBuilder and StringBuffer

The most used data types for variables in any programming language are boolean values, numeric primitive values and “strings” (or arrays) of characters. In contrast with C or C++, in Java handling strings is different because:

  • in Java every char is a 16 bit Unicode value, and not 1 byte;
  • in Java, strings values are managed by String objects;
  • in Java, the syntax allows you to use Strings as primitive data types (you can use = operator to initialize them)
  • in Java, Strings are immutable objects, meaning that once are created, they can’t change their value.

Read the rest of this entry »

,

3 Comments

Tutorial Java SCJP – #10 Domeniul de vizibilitate al variabilelor

Multe erori de compilare sunt generate de programatori deoarece nu au o imagine clara cu privire la domeniul de vizibilitate al variabilelor, cat sunt disponibile si când pot fi accesate. Conceptul de domeniu de vizibilitate  descrie viata unei variabile, sau zona de disponibilitate, dupa ce aceasta a fost definita.

Read the rest of this entry »

1 Comment