JohnG Jackson

Greenhorn
+ Follow
since Apr 14, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by JohnG Jackson

Found the support email, I don't know how to delete the post though
7 years ago
Hello, I came across a very small and subtle typo, is there a place I can report the typo to Oracle? I don't know if they care but I thought I'd ask. The sentence below doesn't close the bracket starting just before the word such.

Additional methods for array operations (such as Object[] toArray() and <T> T[] toArray(T[] a) exist as well.

Too

Additional methods for array operations (such as Object[] toArray() and <T> T[] toArray(T[] a)) exist as well.
7 years ago

Campbell Ritchie wrote:
That I am afraid doesn't make sense. Both interfaces and abstract classes can be used to make objects, but a class/interface isn't an object as such.



Right.. I should know this. Objects are created at runtime. I was told this on an online video and I may have misrepresented it. I guess you can't instantiate either anyways so the comparison sucks.

All valid points!
7 years ago
Hello, I'm new here and to Java so please correct me if I'm wrong but here is the major differences to me;
1. Interfaces are not objects, abstract classes are.
2. Interfaces don't have constructors where sub-classes can inherent field members
3. It used to be that interfaces could have no methods with implementation, rather only abstract methods but with Java 8 interfaces can have default and static methods
4. And I almost forgot; you can implement multiple interfaces but because Java has single inheritance, you can only extend one abstract class at a time.
5. Oh and also, because interfaces are not objects, they are much faster
(But I never proved it myself, conceptually Java handles interface abstract methods as basic names, I'm not quite sure the overhead java has when handling these as objects, it's just something I'm told)

7 years ago