Преобразование между java.time.LocalDateTime и java.util.Date

Да, можно вызвать один конструктор из другого с помощью this()

class Example{
   private int a = 1;
   Example(){
        this(5); //here another constructor called based on constructor argument
        System.out.println("number a is "+a);   
   }
   Example(int b){
        System.out.println("number b is "+b);
   }
437
задан JodaStephen 19 October 2014 в 21:27
поделиться