class Pastatas{
private String adresas;
public Pastatas(String adresas) {
this.adresas = adresas;
}
@Override
public String toString() {
return "Pastatas{" +
"adresas='" + adresas + '\'' +
'}';
}
}
class Valstybe implements Upe{
private String vardas;
private Seimas seimas;
public Valstybe(String vardas, Seimas seimas) {
this.vardas = vardas;
this.seimas = seimas;
}
@Override
public void teka() {
System.out.println("vaslstybe upe");
}
}
class Parlamentaras {
private String name;
private String pavarde;
public Parlamentaras(String name, String pavarde) {
this.name = name;
this.pavarde = pavarde;
}
public String gautiVardairPavarde(){
return name +" "+pavarde;
}
public String getName() {
return name;
}
@Override
public String toString() {
return "Parlamentaras{" +
"name='" + name + '\'' +
", pavarde='" + pavarde + '\'' +
'}';
}
}
interface Upe{
void teka();
}
class Seimas extends Pastatas implements Upe{
String name;
public String getName() {
return name;
}
public Seimas(String adresas, Parlamentaras[] parlamentaras) {
super(adresas);
this.parlamentaras = parlamentaras;
}
@Override
public void teka() {
System.out.println("Salia seimo teka upe Neris");
}
Parlamentaras parlamentaras[];
// public Seimas(Parlamentaras[] parlamentaras, String adresas) {
// super(adresas);
// this.parlamentaras = parlamentaras;
// }
public Parlamentaras[] getParlamentaras() {
return parlamentaras;
}
void prideti_seimo_nari(Parlamentaras p) {
}
void perziureti_narius() {
}
@Override
public String toString() {
return "Seimas{" +
"parlamentaras=" + Arrays.toString(parlamentaras) +
'}';
}
}
public class Main {
public static void main(String[] args) {
Parlamentaras petras = new Parlamentaras("Petras", "Petraitis");
Parlamentaras ona = new Parlamentaras("Ona", "Petraitiene");
Parlamentaras jonas = new Parlamentaras("Jonas", "Jonaitis");
Parlamentaras parlamentarai[] = {petras, ona, jonas};
//System.out.println(petras);
Seimas seimas = new Seimas("Jasinskio g. 15", parlamentarai);
seimas.prideti_seimo_nari(petras);
seimas.perziureti_narius();
Valstybe valstybe = new Valstybe("Lietuva", seimas);
for (Parlamentaras elem: seimas.getParlamentaras()) {
System.out.println(elem.getName());
}
List<Upe> upiu_sarasas = new ArrayList<>();
upiu_sarasas.add(seimas);
upiu_sarasas.add(valstybe);
System.out.println(new Automobilis(new Ratas()));
List<String> li = new ArrayList<>();
li.add("weawwae");
}
}
class Automobilis{
public Automobilis(Ratas ratas) {
}
}
class Ratas{}
What’s New in Java EE 8
Java EE 8 continues to improve API and programming models needed for today’s applications and adds features requested by our world-wide community. This release modernizes support for many industry standards and continues simplification of enterprise ready APIs. Enhancements include:
Java Servlet 4.0 API with HTTP/2 support Enhanced JSON support including a new JSON binding API A new REST Reactive Client API Asynchronous CDI Events A new portable Security API Server-Sent Events support (Client & Server-side) Support for Java SE 8 new capabilities (e.g. Date & Time API, Streams API, annotations enhancements) Java EE 8 builds on Java EE 7. The following JSRs are new or updated in Java EE 8:
JSR 366 – Java EE 8 Platform JSR 365 – Contexts and Dependency Injection (CDI) 2.0 JSR 367 – The Java API for JSON Binding (JSON-B) 1.0 JSR 369 – Java Servlet 4.0 JSR 370 – Java API for RESTful Web Services (JAX-RS) 2.1 JSR 372 – JavaServer Faces (JSF) 2.3 JSR 374 – Java API for JSON Processing (JSON-P)1.1 JSR 375 – Java EE Security API 1.0 JSR 380 – Bean Validation 2.0 JSR 250 – Common Annotations 1.3 JSR 338 – Java Persistence 2.2 JSR 356 – Java API for WebSocket 1.1 JSR 919 – JavaMail 1.6