Which of the following is the correct way of setting values into th

Loading

Choose the correct option.

Which of the following is the correct way of setting values into the structure variable e defined below?

struct Emp { 
public String name;
public int age;
public Single sal;
}
Emp e = new Emp();

A. e.name = "Amol";  e.age = 25;  e.sal = 5500;
B. With e {     .name = "Amol";     .age = 25;     .sal = 5500;  }
C. With emp e {     .name = "Amol";     .age = 25;     .sal = 5500;  }
D. e -> name = "Amol";  e -> age = 25; e -> sal = 5500;

Leave a Comment