0

I was given a java application by my professor that I need to add on to. However, before adding anything on to it I ran the program to make sure it works as is. However, the program keeps printing out java.text.SimpleDateFormat@f9e3bac0. The program is suppose to print out a stock quote which does contain a date object. I'm thinking the date object wasn't formatted correctly but I'm not positive. There are around 20 classes in the project so before I go editing things I wanted to make sure that this means what I think it does. Does this likely mean a date wasn't formatted correctly or needs getTime() called on it?

Thanks

Matthew Tuman
  • 59
  • 2
  • 9
  • 1
    It is printing the object's default `toString` method value showing the class with instance. If you want it to show date with your format then you need to call the appropriate methods. Also have a look at https://stackoverflow.com/questions/29140402/how-do-i-print-my-java-object-without-getting-sometype2f92e0f4 – Balwinder Singh Feb 22 '18 at 01:25
  • Thanks, actually for some reason he had the line 'System.out.println(simpleDateFormat);' by itself. I just happened to spot it now. – Matthew Tuman Feb 22 '18 at 01:27

0 Answers0