Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

data structure java language 4. What is the output of the following program? class student 1 int id, String name; String grade; public student(int id,

data structure java language
image text in transcribed
4. What is the output of the following program? class student 1 int id, String name; String grade; public student(int id, String name, String grade)f this id =id; this. name = name; this grade = grade; @Override public String toString() I return "Student!" + "idn" + id +", name=" + name + ", grade =+grade +7: Set> names = new HashSet> (1): Setestudent> st a new HashSet1); student s1 = new student(1, "Mohammad". "A+"); student s2 = new student(2, "Ahmed", "A"): student s3 = new student(3, "Sara", "A"): student s2 = new student(4, "Fatima", "A+"); st.add(s1); st.add(s2); st.add(s3); st.add(s4); st.add(s4); names.add("Mohammed Khalid 1"): names.add("Mohammed Khalid 2"): names.add("Mohammed Khalid3"): names. add("Mohammed Khalid3"): names.add("Mohammed Khalid2"): for (String name: names) \{ System.out.print(namet" "): // 1 for (student u: st) \{ System.out.println(u)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Image Databases Towards Advanced Image Retrieval

Authors: Yihong Gong

1st Edition

1461375037, 978-1461375036

More Books

Students also viewed these Databases questions

Question

What are the primary purposes of appraising employees?

Answered: 1 week ago