The typical pattern here is a class with only private or package default constructors, combined with a factory method that is either a public static method of the class or a method of an accompanying factory class. You get LocalDate objects from many static methods listed in the javadoc.

Answer from bmargulies on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDate.html
LocalDate (Java Platform SE 8 )
October 20, 2025 - Java™ Platform Standard Ed. 8 ... Serializable, Comparable<ChronoLocalDate>, ChronoLocalDate, Temporal, TemporalAccessor, TemporalAdjuster · public final class LocalDate extends Object implements Temporal, TemporalAdjuster, ChronoLocalDate, Serializable
🌐
Baeldung
baeldung.com › home › java › java dates › creating a localdate with values in java
Creating a LocalDate with Values in Java | Baeldung
January 8, 2024 - Creating a date in Java had been redefined with the advent of Java 8. Besides, the new Date & Time API from the java.time package can be used with ease relative to the old one from the java.util package. In this tutorial, we’ll see how it makes a huge difference. The LocalDate class from the java.time package helps us achieve this.
🌐
Joda
joda.org › joda-time › apidocs › org › joda › time › LocalDate.html
LocalDate (Joda-Time 2.14.1 API)
Constructs a LocalDate from a java.util.Date using exactly the same field values.
🌐
Blogger
javarevisited.blogspot.com › 2017 › 01 › how-to-create-localdatetime-in-java-8.html
How to create LocalDateTime in Java 8 - Example Tutorial
LocalDate retrievedDate = fromDateAndTime.toLocalDate(); LocalTime retrievedTime = fromDateAndTime.toLocalTime(); System.out.println("retreived LocalDate : " + retrievedDate); System.out.println("retreived LocalTime : " + retrievedTime); This ...
🌐
How to do in Java
howtodoinjava.com › home › java date time › java localdate
Java LocalDate (with Examples) - HowToDoInJava
April 7, 2023 - The java.time.LocalDate class, introduced in Java 8, represents a local date without time and zone information e.g.
🌐
CodeGym
codegym.cc › java blog › core java › java localdate class
Java LocalDate class
May 15, 2023 - Besides the now() method, LocalDate provides several other constructors that allow you to create LocalDate instances from different sources. For example, you can create a LocalDate from a specific year, month, and day: import java.time.LocalDate; ...
Find elsewhere
🌐
Coderanch
coderanch.com › t › 681436 › java › Constructor-LocalDate
Constructor for LocalDate (Java in General forum at Coderanch)
I googled and found a long answer: http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html http://www.journaldev.com/2800/java-8-date-time-api-example-tutorial-localdate-instant-localdatetime-parse-and-format ... If the javadocs don't show any constructor, that means you can't initialise it directly; any constructor the class has is either private or package private.
🌐
Javatpoint
javatpoint.com › java-localdate
Java LocalDate
It inherits Object class and implements the Comparable interface. class declaration Let's see the declaration of java.time.LocalTime class. public final class LocalTime extends Object implements Temporal, TemporalAdjuster, Comparable&lt;LocalTime&gt;, Serializable Methods of Class Method Description LocalDateTime...
🌐
Jenkov
jenkov.com › tutorials › java-date-time › localdate.html
Java LocalDate
The LocalDate Java class is located in the java.time package, so its fully qualified class name is java.time.LocalDate.
🌐
Reddit
reddit.com › r/androiddev › how can i add an empty constructor to localdate class?
r/androiddev on Reddit: How can I add an empty constructor to LocalDate class?
March 26, 2024 -

So I have a dataclass todoItem

data class TodoItem(
        var id : Int,
        var title: String,
        var createdOn : LocalDate,
        var dueDate : LocalDate,
        var tags : List<String>,
        var description  : String
){
        constructor(): this(
                id = 0,
                title = "",
                createdOn = LocalDate.parse("2020-01-01"),
                dueDate = LocalDate.parse("2020-01-01"),
                tags = emptyList(),
                description = ""
        )
}

I am adding these todoItems to my cloud Firestore and when getting them back, I want to convert them into this dataclass again

val firestore_data = user?.let {
            Firebase.firestore.collection(it.uid).get()
                .addOnSuccessListener { documents ->
                    for (document in documents) {
                        val todoItem = document.toObject(TodoItem::class.java)
                        Log.d("TAG", "$todoItem")
                    }
                }
                .addOnFailureListener { exception ->
                    Log.w("TAG", "Error getting documents: ", exception)
                }
        }

But I am getting the following error

Process: com.umang.reminderapp, PID: 2346
                                                                                                    java.lang.RuntimeException: Could not deserialize object. Class java.time.LocalDate does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped (found in field 'dueDate')

How do I resolve this ?

🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
To display the current date, import the java.time.LocalDate class, and use its now() method:
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-time-localdate-class-in-java
java.time.LocalDate Class in Java - GeeksforGeeks
July 23, 2025 - Use LocalDateTime.now() and now() method. Use DateTimeFormatter.ofPattern to sort the current date. Display the date which is stored in the variable. Below is the implementation of the problem statement: ... // import package used to work with ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-8-date-localdate-localdatetime-instant
Java 8 Date - LocalDate, LocalDateTime, Instant | DigitalOcean
August 3, 2022 - We can also provide input arguments for year, month and date to create LocalDate instance. This class provides an overloaded method for now() where we can pass ZoneId for getting dates in a specific time zone. This class provides the same functionality as java.sql.Date.
🌐
SourceForge
joda-time.sourceforge.net › apidocs › org › joda › time › LocalDate.html
LocalDate (Joda time 2.2 API)
Constructs a LocalDate from a java.util.Calendar using exactly the same field values.
🌐
Buggybread
buggybread.com › 2015 › 02 › error-constructor-localdatetimelocaldat.html
ERROR - The constructor LocalDateTime(LocalDate, LocalTime) is not visible
Sample Code LocalDateTime currentTime = new LocalDateTime(null, null); Cause Constructors for LocalDateTime are all private.