import java.io.*; import java.util.Scanner; class Name { private int a; private float b ; int getA() {return a;} void setA(int newA) {a=newA;} float getB() {return b;} void setB(float newB) {b=newB;} } public class tre{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Name[] ptr; Name[] p = {new Name()}; ptr = p; System.out.print("scrivi intero: "); ptr[0].setA(scanner.nextInt()); System.out.print("scrivi float: "); ptr[0].setB(scanner.nextFloat()); System.out.print("stampa: "); System.out.printf("%d %f\n", ptr[0].getA(), ptr[0].getB()); } }