Answered step by step
Verified Expert Solution
Question
1 Approved Answer
fix the code import java.io.*; import java.util.Scanner; class Student{ private String name; private int id; public double q1; public double q2; public double q3; public
fix the code
import java.io.*;
import java.util.Scanner;
class Student{
private String name;
private int id;
public double q1;
public double q2;
public double q3;
public void setName(String name){
this.name=name;
}
public void setld(int id){
this.id=id;
}
public String toString(){
return"Student[name="+name+",id="+id+",q1="+q1+",q2="+q2+",q3="+q3+"]";
}
}
class Main{
public static void main(String[] args) {
Student student1=new Student();
Studentone.setName("jeje");
Studentone.setId(123);
Studentone.q1=80.5;
Student1.q2=90.0;
Student1.q3=70.0;
System.out.println( Student1.toString());
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started