Professional Documents
Culture Documents
Class – template care descrie comportamentul si caracteristicile obietelor sale; O clasa poate contine
mai multe metode;
Methods – un comportament; where all the actions are executed; cu litera mica; object-to-object
communication
Instance Variables – fiecare obiect are un set unic de variabile instant; caracteristica unui obiect este
creata de valoril asignate acestor avriabile instant;
System.out.println (“Tina”);
Identifiers – names used for classes, variables, methods; - begin with a letter, character or
underscore
Java Variables
Mostenire – interfata
Regular expressions:
Ce stii despre JAVA? -> limbaj de programare ce ruleaza pe multe platforme: Win, Mac, UNIX –
Solaris, RedHat Linux, Ubuntu, CenOS
Features of JAVA -> Object Oriented, Platform Independent, Robust, Interpreted, Multi-threaded
High – Performance -> Java uses Just-In-Time compiler to enable high performance.
Object – entity ; its behavior is shown via methods; methods – object-to-object communication;
Class – in interiorul ei sunt create obiecte; clasa poate contine fields and methods to describe the
behavior of an object;
Instance V: in interiorul clasei dain in afara metodei; sunt initializate cand clasa e
incarcata;
Singleton class: control object creation, limiting the number to one but allowing the
flexibility to create more objects if the situation changes.
Constructor: fiecare clasa are un constructor; constructorul este invocate atunci cand
un nou obiect este creat; daca nu scriem un constructor pentru o clasa, compilatorul
java construieste un constructor default pt ea
Default value for byte datatype=0; - used to save space in large arrays; mai mic decat int
Finalize() method – used to ensure than an object terminates cleanly; is called just before an
objects’s final destruction
Abstract Class- nu pot fi instantiate si sunt partial sau deloc implementate. Aceasta clasa
contine mai multe metode abstracte - care sunt doar declarii de metoda, fara body;
Encapsulation – private fields in a class and providing access to the fields via public methods.
Benefit: the ability to modify our implemented code without breaking the code of others use
our code;
Nu poate fi instantiate
Nu contine consructori
Multithreaded program – contains two or more parts that can run concurrently. Each part of such a
program is called a thread, and each thread defines a separate path of execution;
Thread can be created by: implementing Runnable interface, extending Thread class
Overloading Method – if a class has multiple functions by same name but different para,etters
Wrapper classes – allow primitive types to be accessed as objects: Integer, Character, Dourble,
Boolean;
Constructors must have the same name as the class and cannot return a value. They are only called
once;
Primitive types – byte, char, short, int, long, float, double and Boolean