Sunteți pe pagina 1din 12

Programare

Bibliografie

Horia Georgescu, Introducere n universul Java, Editura


tehnic, Bucureti, 2002.
Stefan Tanas, Cristian Olaru, tefan Andrei, Java de la 0 la
expert (ediia a II-a), Editura Polirom, 2007, 2011.
Cristian Frsinaru, Curs practic de Java, Bucureti, Editura
Matrix Rom, 2005.
Daniel Danciu, George Mardale, Arta programrii n Java,
vol. I - Concepte fundamentale, Editura Albastr
Daniel Danciu, George Mardale, Arta programrii n Java,
vol. II - Algoritmi i structuri de date, Editura Albastr
Florian Mircea Boian, Rare Florin Boian, Tehnologii
fundamentale Java pentru aplicaii Web, Editura Albastr,
Cluj-Napoca, 2004.
Bruce Eckel, Thinking in Java, Prentice Hall, 2003
Michael Morrison, Sams Teach Yourself Wireless Java with
J2ME in 21 Days, Sams, 2001.

Obiectivele cursului

Introducere n Java
Clase i obiecte n Java
Fluxuri de intrare/ieire
Excepii i manipularea acestora
Interfee, pachete, serializarea obiectelor
Applet-uri
Internaionalizarea aplicaiilor
Interfee grafice
Fire de execuie
Lucrul cu baze de date n Java
Tehnologia Java Servlet
Java Server Pages (JSP)
Introducere n J2ME

Legturi utile
http://thor.info.uaic.ro/~acf/java/
http://www.mindview.net/Books/TIJ/
http://docs.oracle.com/javase/tutorial/
http://profs.info.uaic.ro/~stanasa/java/core/
index.html
http://docs.oracle.com/javase/6/docs/api/

Instalare
Java
http://www.java.com/en/download/index.jsp
IDE
http://netbeans.org/downloads/ sau
http://www.eclipse.org/downloads/
De adugat calea ctre Java\jdk\bin la PATH:
My Computer -> Properties -> Advanced system
settings -> Environment variables -> Path -> adugai
C:\Program Files\Java\jdk1.7.0_06\bin;

FirstApp.java
class FirstApp{
public static void main(String args[]){
System.out.println("Hello, world!");
}
}

Salvare cu nume fiier: FirstApp.java


Compilarea se face utiliznd compilatorul javac.exe:
javac FirstApp.java
n urma ei va rezulta un fiier FirstApp.class
Pentru execuie se apeleaz interpretorul java.exe
java FirstApp

Compilarea din linia de


comand

SecondApp.java
public class SecondApp{
public static void main(String args[]){
System.out.println("Parametrii sunt:");
for (int i=0; i<args.length; i++)
System.out.println(args[i]);
}
}
===============
javac SecondApp.java
java SecondApp lista_identificatori

Eclipse /
NetBeans
Crearea unui
proiect Java:
File -> New Java
project

Eclipse /
NetBeans
Crearea unei
noi clase Java:
File -> New Java
class

import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
public class LucruFisiere {
public static void main(String[] args) {
File f = new File(".");
File[] files = f.listFiles();
try {
FileWriter fw = new FileWriter("out.txt");
PrintWriter pw = new PrintWriter(fw);
pw.write("Directorul curent este: " + f.getAbsolutePath() + "\n");
pw.write("Fisierele din directorul curent sunt: " + "\n");
for (int i = 0; i < files.length; i++)
pw.write(files[i].getAbsolutePath() + "\n");
pw.print("Am terminat...");
pw.close();
fw.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}