Aplicatie Java Cu Clasa Vector

  • Uploaded by: deianira
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Aplicatie Java Cu Clasa Vector as PDF for free.

More details

  • Words: 94
  • Pages: 1
//aplicatie cu tipul de date Vector ;clasa java.util.Vector;

import java.util.Vector; class Filme { int an_aparitie; String nume,regizor; Filme(String nume,String regizor,int an_aparitie) { this.an_aparitie=an_aparitie; this.nume=nume; this.regizor=regizor; } public String toString() { return("Nume: "+ nume+""+" regizor: "+regizor+""+" an aparitie: "+an_aparitie); } } //sfarsitul clasei Filme

public class AplicatieVector { public static void main (String[] args) { Vector listaFilme=new Vector();//declararea vectorului in care se vor memora filmele listaFilme.addElement(new Filme("Heat","Michael Mann",1995)); listaFilme.addElement(new Filme("Ronin","John Frankenheimer",1998)); listaFilme.addElement(new Filme("The Mission","Roland Joffé",1986)); listaFilme.addElement(new Filme("The Deer Hunter","Michael Cimino",1978)); listaFilme.addElement(new Filme("Taxi Driver","Martin Scorsese",1976)); for (int i=1;i<listaFilme.size();i++) { Filme curent=(Filme)listaFilme.elementAt(i); System.out.println("filmul"+i+":"); System.out.println(curent); } } }

Related Documents


More Documents from "lil_petrea"

May 2020 18
Prefixoide
December 2019 12
Kirac-siyah Gece Lyrics
December 2019 17