Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to implement a method in a code which shows me the paramaters and details of an object I created my code is below

I want to implement a method in a code which shows me the paramaters and details of an object I created
my code is below here. But I did not see any results in a Console when I run the code. How can I achieve the requested result
List studentList = new
ArrayList();
studentManagement student1 = new studentManagement(101,"Berkay",(float)3.6);
studentManagement student2 = new studentManagement(102,"Kaan",(float)3.8);
studentManagement student3 = new studentManagement(103,"Yaman",(float)3.6);
studentManagement student4 = new studentManagement(101,"Berkay",(float)3.6);
studentManagement student5 = new studentManagement(102,"OG",(float)3.0);
showStudent(student1);
}
public void showStudent(studentManagement student) {
String output = student.toString();
System.out.println(output);
}
public String toString() {
return this.studentID + ", " + this.studentname + "," + this.GPA;
image text in transcribed
package workshop;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
public class studentManagement {
public int studentID;
public String studentname;
public float GPA;
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public studentManagement(int studentID, String studentname, float gPA) {
super();
this.studentID = studentID;
this.studentname = studentname;
this.GPA = gPA;
}
public void inputStudent() {
List studentList = new ArrayList();
studentManagement student1 = new studentManagement(101,"Berkay",(float)3.6);
studentManagement student2 = new studentManagement(102,"Kaan",(float)3.8);
studentManagement student3 = new studentManagement(103,"Yaman",(float)3.6);
studentManagement student4 = new studentManagement(101,"Berkay",(float)3.6);
studentManagement student5 = new studentManagement(102,"OG",(float)3.0);
showStudent(student1);
}
public void showStudent(studentManagement studentz) {
System.out.println(toString());
}
public String toString() {
return studentID + ", " + studentname + "," + GPA;
}
public int getStudentID() {
return studentID;
}
public void setStudentID(int studentID) {
this.studentID = studentID;
}
public String getStudentname() {
return studentname;
}
public void setStudentname(String studentname) {
this.studentname = studentname;
}
public float getGPA() {
return GPA;
}
public void setGPA(float gPA) {
GPA = gPA;
}
}
Navigate Search Project Run Window Help eclipse-workspace - workshop/src/workshop/studentManagement.java - Eclipse IDI A studentManagementjava studentList.java module-info.java this.GPA = gPA; 7o public void inputStudent() { ListestudentManagement> studenthist = new ArrayListo(); studentManagement studenti = new studentManagement (101, "Berkay",(float)3.6); studentManagement student2 = new studentManagement (102, "Kaan",fioat)3.8); studentManagement student3 = new studentManagement (103, "Yaman", (float)3.6); studentManagement student4 = new studentManagement(181, "Berkay", (float)3.6); studentManagement students = new studentManagement (182, "0G",(float)3.0); showStudent (student1); 10 public void showStudent(studentManagement student) { String output = student.tostring (); System.out.println(output); 20 public String tostring() { -4 return this.studentID + ", + this.studentname + + this.GPA; 80 public int getStudentID() { return studentID; Problems O Javadoc Declaration Console erminated> studentManagement [Java Application) Library/Java/JavavirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java Writable Smart Ineart

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago