subject

What is wrong with line 1?

public class G
{
private int x;
public G() { x=3;}
public void setX(int val){
x=val;
}
public String toString(){
return ""+x;
}
}

public class H extends G
{
private int y;
public H() { y=4;}
public void setY(int val){
y=val;
}
public String toString() {
return ""+y+super. toString();
}
}

//test code in the main method
G bad = new H();
bad. setY(9); //line 1

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
You know the right answer?
What is wrong with line 1?

public class G
{
private int x;
public G()...
Questions
question
Computers and Technology, 30.01.2020 06:04
question
Mathematics, 30.01.2020 06:04
Questions on the website: 13722367