Generation

generate functionTue, 02 May 2023

crear una red de computadoras

import java.io.PrintWriter; public class Puntos { public static void main(String[] args) { PrintWriter salida = new PrintWriter(System.out); Punto p1 = new Punto(0, 0); Punto p2 = new Punto(1, 1); Punto p3 = p1.sumar(p2); salida.println(p3.getX()); salida.close(); } } class Punto { private int x; private int y; public Punto(int x, int y) { this.x = x; this.y = y; } public int getX() { return this.x; } public int getY() { return this.y; } public double distancia(Punto otroPunto) { return Math.sqrt((this.x - otroPunto.x) * (this.x - otroPunto

Questions about programming?Chat with your personal AI assistant