Código
import java.io.*; import java.net.*; import javax.swing.JOptionPane; public class DatosPC { public DatosPC() { } { try { return(ip.getHostAddress()); } return "No hay ip"; } { try { return(ip.getHostName()); } return "Sin host"; } DatosPC dp= new DatosPC(); } }