When we write Instance variables in the body of the class and given that the constructor initializes them, then why can we Initialize the variables directly and outside the constructor without going to the constructor? isn't that the constructor's duty?
class Sample{
LinkedList<String> string=new LinkedList<>();//Initializing in the body of the class
String value="Hi";//Initializing in the body of the class
public Sample(){
//shouldnt string and value initialize here?}
}