Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/04/2014, 00:37
Avatar de rgf1987
rgf1987
 
Fecha de Ingreso: diciembre-2012
Ubicación: Asturias
Mensajes: 269
Antigüedad: 11 años, 4 meses
Puntos: 22
Respuesta: regresar Fecha

Buenas,

fijate bien en lo que estás haciendo:

Cita:
Iniciado por FerTovar Ver Mensaje

public static void main(String[] args) {
// TODO code application logic here
Fecha x11=new Fecha();
x11.Fecha();
String x22;
x22=String.valueOf(x11);
System.out.print("Valor Regresado..... "+x22+" ");

}
Creas un objeto de tipo Fecha "x11", luego llamas al método Fecha() el cuál devuelve un String, pero no estás almacenando ese String devuelto en ningún sitio, lo que haces es imprimir el objeto Fecha, por eso te imprime ese valor " fecha.Fecha@4f9f6e39".

Obtén el String retornado e imprime el valor.

Código Java:
Ver original
  1. String fechaRetorno = x11.Fecha();
  2. System.out.println(fechaRetorno);