java - Using a char when creating a new object -
i have student class need have grade character when creating object. how write in object parameters? if use quotes thinks it's string, , if write grade a, thinks it's variable. parameters are:
string name string adress integer birthdate integer age string course char grade string school student student1 = new student("john", "random street 1", 891117, 23, "java", a, "hig" );
chars wrapped within single quotes '
student student1 = new student("john", "random street 1", 891117, 23, "java", 'a', "hig" );
Comments
Post a Comment