Good afternoon friends!

The following code is available:

class FileInfo { public static String NameFile; public static String TypeFile; public static int SizeFile; public static String DateCreate; public static String DateEdit; } 

And another class:

 public class View_files_folders { public ??? getItem(int number) { } } 
  • The first question is how to make the getItem function return the class FileInfo?
  • The second question is, are there special date and time data types in Java, if so, which module should be connected? So that the DateCreate and DateEdit fields should not be made of type String if possible.
  • How to make getItem return an object?
  • four
    With such questions, you first need to refer to the documentation / book / lessons on Java (for example, docs.oracle.com/javase/tutorial ) - a_gura
  • I do not have time to read the textbook. It is necessary to do this task as quickly as possible, but unfortunately I don’t yet know Java, I only find information on the Internet and logically as I do in other languages. I also ask for help on the forums. like this ... do not minus me for not knowing ... ( - IntegralAL

3 answers 3

2) Date, GregorianCalendar
Third-party: JodaTime

  • It is worth noting that java.util.Date used to store the date value, and the heirs of java.util.Calendar is used to manipulate the date / time. - Nofate
 public FileInfo getItem(){} 
  • Thank you, but what about the other questions? - IntegralAL
  • 2) as far as I remember, no 3) did not understand the question 4) return new SomeClass (); - woland

Java 8 has a wonderful library for working with time: Article on Habré