Question: Suppose you have the following declarations in a program: String lastName = ' ' ; / / Variable that is initialized with an empty string.

Suppose you have the following declarations in a program:
String lastName =''; //Variable that is initialized with an empty string.
int age =0//Variable that stores a person's age.
char firstInitial =''; //Variable that stores a person's first initial.
double gpa ==0.0; //Variable that stores a person's/student's GPA.
Which declaration is coded correctly?
Group of answer choices
String lastName ='';
int age =0
char firstInitial ='';
double gpa ==0.0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!