Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Java have automatic properties like C#? [closed]

C# has automatic properties which greatly simplify your code:

public string Name { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }

Whereas Java has you write this much code:

private String name;
private String middleName;
private String LastName;

public String Name(){
   return this.name;
}

etc..

Is there a particular reason Java hasn't implemented something like this?


1 Answers

Yep, because it doesn't have it. As the saying goes, all features start out unimplemented.

like image 102
Noon Silk Avatar answered Sep 15 '25 05:09

Noon Silk