solve the error
-
public class student{
private int ID;
private String Name;
Student class constructor
student(int id, String name){
this.ID = id;
this.Name = name;}
public int getid(){
return this.ID;}
public String Getname(){
return this.Name;}
public void SETid(int i){
this.ID = i;}
public void sETNAme(String n){
this.Name=n;}
method to display data
public void display() {
System.out.println("Student id is: " + id + " "
+ "and Student name is: "- Name;);
System.out.println();
}}
- Name;);
-
public class student{
private int ID;
private String Name;
Student class constructor
student(int id, String name){
this.ID = id;
this.Name = name;}
public int getid(){
return this.ID;}
public String Getname(){
return this.Name;}
public void SETid(int i){
this.ID = i;}
public void sETNAme(String n){
this.Name=n;}
method to display data
public void display() {
System.out.println("Student id is: " + id + " "
+ "and Student name is: "- Name;);
System.out.println();
}}
No. Even if you'd asked nicely, you haven't bothered to tell us what "the error" is. Dumping your code without explanation and demanding that someone "solve the error" is a great way to alienate people, and ensure nobody wants to help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
- Name;);
-
public class student{
private int ID;
private String Name;
Student class constructor
student(int id, String name){
this.ID = id;
this.Name = name;}
public int getid(){
return this.ID;}
public String Getname(){
return this.Name;}
public void SETid(int i){
this.ID = i;}
public void sETNAme(String n){
this.Name=n;}
method to display data
public void display() {
System.out.println("Student id is: " + id + " "
+ "and Student name is: "- Name;);
System.out.println();
}}
Let's start by formatting the code and adding ;line numbers so it is actually readable. You can now clearly see that at the very least you have invalid lines at lines numbers 5 and 22. I assume these are supposed to be comment lines so require a "//" at the beginning. You also have mixed capitalisation on your setters and getters. So start by fixing those and see what happens.
public class student{
private int ID;
private String Name;Student class constructor student(int id, String name){ this.ID = id; this.Name = name; } public int getid(){ return this.ID; } public String Getname(){ return this.Name; } public void SETid(int i){ this.ID = i; } public void sETNAme(String n){ this.Name=n; } method to display data public void display() { System.out.println("Student id is: " + id + " " + "and Student name is: " + Name; ); System.out.println(); }
}
- Name;);
-
public class student{
private int ID;
private String Name;
Student class constructor
student(int id, String name){
this.ID = id;
this.Name = name;}
public int getid(){
return this.ID;}
public String Getname(){
return this.Name;}
public void SETid(int i){
this.ID = i;}
public void sETNAme(String n){
this.Name=n;}
method to display data
public void display() {
System.out.println("Student id is: " + id + " "
+ "and Student name is: "- Name;);
System.out.println();
}}
You forget to add // on commenting lines that is in line number 5 and 22
public class student{
private int ID;
private String Name;//Student class constructor student(int id, String name){ this.ID = id; this.Name = name; } public int getid(){ return this.ID; } public String Getname(){ return this.Name; } public void SETid(int i){ this.ID = i; } public void sETNAme(String n){ this.Name=n; } // method to display data public void display() { System.out.println("Student id is: " + id + " " + "and Student name is: " + Name; ); System.out.println(); }
}
- Name;);
-
You forget to add // on commenting lines that is in line number 5 and 22
public class student{
private int ID;
private String Name;//Student class constructor student(int id, String name){ this.ID = id; this.Name = name; } public int getid(){ return this.ID; } public String Getname(){ return this.Name; } public void SETid(int i){ this.ID = i; } public void sETNAme(String n){ this.Name=n; } // method to display data public void display() { System.out.println("Student id is: " + id + " " + "and Student name is: " + Name; ); System.out.println(); }
}
-
He already did, when he cut'n'pasted it
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
-
He already did, when he cut'n'pasted it
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012