21 lines
467 B
Java
21 lines
467 B
Java
package objectAnalyzer;
|
|
|
|
import java.util.*;
|
|
|
|
/**
|
|
* This program uses reflection to spy on objects.
|
|
* @version 1.13 2018-03-16
|
|
* @author Cay Horstmann
|
|
*/
|
|
public class ObjectAnalyzerTest
|
|
{
|
|
public static void main(String[] args)
|
|
throws ReflectiveOperationException
|
|
{
|
|
var squares = new ArrayList<Integer>();
|
|
for (int i = 1; i <= 5; i++)
|
|
squares.add(i * i);
|
|
System.out.println(new ObjectAnalyzer().toString(squares));
|
|
}
|
|
}
|