A teacher gave me this lecture with some questions, and I am somewhat confused.
Say we have a hierarchy like:
Object
|
+---A
|
+---B
|
+---C
and we made these methods in Class A:
public abstract void method1();
public abstract void method2(int i);
so... these questions were presented to us:
(a) If class B does not override any of the two methods above, can class B be compiled cleanly? If so, can an object be created from class B? If not, explain why not.
(b) Now assume that class B overrides method1 given above. Can class B be compiled cleanly? If so, can an object be created from class B? If not, explain why not.
(d) In defining class A described above, must the abstract modifier be used in the 1st line of the class definition (or is it optional given that it has abstract method(s) in it)?
(e) In defining method1 and method2 described above, must the abstract modifier be used in the method statement (or is it optional given that it has no method body)?
Ok, so if a subclass, which would be B, doesn't override the abstract methods, it becomes an abstract class, correct? But I'm not really sure if it can create an object or not, I don't believe it can, but can someone at least elaborate on this.
yeah it seems to be Edge only. The dialog buttons work as expected in Chrome and Firefox. The phone is using Android 16 (OneUI 8.5) and Edge version 149.0.4022.53
I'm not aware of this issue, but to help the other guys.
What version of Android are you using?
Did you try a different browser? To see if Edge is the issue here.
I agree when are you going to read this (really poor BTW) article?
Here is a better article so you actually know what is going on and answers questions you had in other comments --> https://arstechnica.com/gadgets/2026/05/speed-boosting-low-latency-profile-is-one-of-the-improvements-coming-to-windows-11/
It is unclear if one will be able to disable the new profile at this point but I am not seeing any reason why one would.
I disagree; they come off very "bitchy" and "whiny".
Make a great product and combine that with a great price (free) and people will come over to your side. Or build it and they will come as they say.
Constantly trying to get attention by complaining all the time, will turn people off to your product.
Question
LRoling
A teacher gave me this lecture with some questions, and I am somewhat confused.
Say we have a hierarchy like:
Object
|
+---A
|
+---B
|
+---C
and we made these methods in Class A:
public abstract void method1();
public abstract void method2(int i);
so... these questions were presented to us:
(a) If class B does not override any of the two methods above, can class B be compiled cleanly? If so, can an object be created from class B? If not, explain why not.
(b) Now assume that class B overrides method1 given above. Can class B be compiled cleanly? If so, can an object be created from class B? If not, explain why not.
© Now assume that class C overrides method2 given above (with the assumption that B overrides method1, as discussed in part(b)). Can class C be compiled cleanly? If so, can an object be created from class C? If not, explain why not.
(d) In defining class A described above, must the abstract modifier be used in the 1st line of the class definition (or is it optional given that it has abstract method(s) in it)?
(e) In defining method1 and method2 described above, must the abstract modifier be used in the method statement (or is it optional given that it has no method body)?
Ok, so if a subclass, which would be B, doesn't override the abstract methods, it becomes an abstract class, correct? But I'm not really sure if it can create an object or not, I don't believe it can, but can someone at least elaborate on this.
Any help would be appreciated.
Link to comment
https://www.neowin.net/forum/topic/233031-java-abstract-class-concept/Share on other sites
7 answers to this question
Recommended Posts