• Register

Recent questions tagged inheritance

1 vote
1 answer 25 views
Problem: Hello all, Please explain to me the error in the following program. class test { String name="name"; public person(String nm){name=nm;} } class emp extends test { String empid="0000"; } public class emptest { public static void main( ... class emp extends test required: String found no arguments reason: actual and formal argument lists differ in length Thanks for the effort. Best regards
asked Mar 10 Gavin 15.2k points
0 votes
1 answer 47 views
Problems: Can anyone give the right solution? From the choices below select the correct order to code CSS pseudo-classes? a. link, hover, visited, active b. hover, link, active, visited c. link, visited, hover, active d. link, hover, active, visited
asked Feb 14 maddi86 5.4k points
0 votes
1 answer 48 views
Problem : I have the below two classes public class A {     A() {         System.out.println("A");     } } class B extends A {     B() {         System.out.println("B");     } } And after that running 1 A c = new B(); or 2 B c = new B( ... glance, in either of the scenario, I would assume that only a B constructor would be called and so the only output would be B But this is completely wrong.
asked Jan 23 jwilliam 3.9k points
0 votes
1 answer 36 views
Problem : I have following two classes: JDialog and JFrame (see signature below). I want them to have few extra methods, but I also want them both to extend my code, without rewriting the code Is it possible to do that? java.awt.Window java.awt.Dialog javax.swing. ... the identical way. So I will not want to write the code twice. I want only one class to utilize the code of the other class.
asked Dec 7, 2019 alecxe 7.5k points
To see more, click for the full list of questions or popular tags.