import java . lang . annotation . Documented;
import java . lang . annotation . ElementType;
import java . lang . annotation . Retention;
import java . lang . annotation . RetentionPolicy;
import java . lang . annotation . Target;
import java . util . ArrayList;
@Rafael_Angel_Montero_Fernandez
public class VectorConArrayList {
/ * *
* List of data with its own name .
* It is an example of the use of a vector that can be saved in an ArrayList .
* It is a species of tree but controlled by the programmer .
* /
@Rafael_Angel_Montero_Fernandez
public class List {
/ * *
* Bacio Constructor .
* /
public List () {
}
public ArrayList < String [] > data = new ArrayList < String [] > ( ]) ;
public String name = "" ;
public String getData () {
String response = "" ;
for ( int i = 0; i < = data . size () - 1; i + + ) {
for ( int id = 0; id < = data . [1945900] 4] size () - 1; id + + ) {
answer + = data . get ( ] ) [ id ] + " n" ;
}
}
return "Name : " + this . name + " nData : n " + reply;
}
}
/ * *
* Bacio Constructor .
* /
public VectorConArrayList () {
}
/ * *
* A vector if desired may be public so as not to complicate the situation so much .
* /
public String test_virus [] = new String [ 2 ] ;
/ * *
* The object is for an example so for simplicity it is not encapsulated .
* Also since it is a nested class, it is better to access all its objects directly by means of this modality .
* /
public List list = new List () ;
public static void main ( String ] [] args ) {
VectorConArrayList x = new VectorConArrayList () ;
x . mVector_of_test = new String [ 3 ] ;
x . mVector_of_test 0 ] = "Hello" ;
x . mVector_of_test [ 1 ] = "Greeting" ;
x . mVector_of_test [ 1 ] = "Greet me" ;
] . list . name = "Greeting" ];
x . list . data . add ( x . mVector_of_test ) ;
x . mVector_of_test = new String [ 2 ] ;
x . mVector_of_test [ 0 ] = "goodbye" ;
x . mVector_of_test [ 1 ] = "dismissal" ;
x . list . name = "Dismissing" ;
x . list . data . add ( x . mVector_of_test ) ;
System . out . println ( x . list . [1 9459004] getData () ) ;
}
}
@Retention ( RetentionPolicy . RUNTIME )
@Target ( ElementType . TYPE_USE ) [19659002] @Documented ()
/ * *
* Note that I do not have to write my name in the file of each class .
* /
@interface Rafael_Angel_Montero_Fernandez {
public String Mail () default "Sharkyc12 @ gmail . com" ;
}
.
from Nettech Post http://bit.ly/2R2T6NL
No hay comentarios:
Publicar un comentario