fork download
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package practicadirigida;
  7.  
  8. /**
  9.  *
  10.  * @author alumno
  11.  */
  12. public class CPunto2D {
  13. double cx; //POR DEFECTOS SON PRIVADOS y son solo accedidos por la clase Cpunto2D
  14. double cy;
  15.  
  16. public void Cpunto2D(double x,double y){
  17. cx=x;
  18. cy=y;
  19. }
  20. public void setValorX(double x){
  21. cx=x;
  22. }
  23. public void setValorY(double y){
  24. cy = y;
  25. }
  26. public double getValorX(){
  27. return cx;
  28. }
  29. public double getValorY(){
  30. return cy;
  31. }
  32. }
  33.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: class CPunto2D is public, should be declared in a file named CPunto2D.java
public class CPunto2D {
       ^
1 error
stdout
Standard output is empty