|
This is a pretty simple (I think) question, since I'm pretty retarded.code:
The API says to use sort I need to implement the Comparable interface, which Dog does. But when I do that, I get an error saying "Dog is not abstract and does override abstract method compareTo(java.lnag.Object) in java.lang.Comparable" So yea, I'm trying to just alphabetize (and then display) an Array List. Not really sure what I'm doing wrong.
|
# ¿ Mar 15, 2011 04:42 |
|
|
# ¿ Apr 23, 2024 22:58 |
|
Why is equals() better than ==? I'm a huge noob at all of this... and in related news! The reason why I came to this thread. I'm taking a Design Patterns course that uses Java, but I'm much more comfortable with the .net framework (specifically C#). Trying to write a try-catch statement to verify some input from the user. Unlike a try-catch from what I'm used to, this REQUIRES some sort of error to throw- I can't just print out my own error message. Basically code:
e; Looks like I've just got to make my own class that interfaces* Exception? *Is that the proper term? I can never keep abstract/interface/whatever else straight Sab669 fucked around with this message at 00:45 on Oct 31, 2011 |
# ¿ Oct 31, 2011 00:43 |
|
Right right, thanks for the quick responses.
|
# ¿ Oct 31, 2011 01:09 |
|
I know there's a brief overview of a few IDEs on the first page, but I was hoping to get a little more information on Netbeans VS Eclipse. I'm still a student, and when I took a Java course we used NetBeans. I'm taking a Design Patterns course this semester which is also in Java and the professor only lets us use Eclipse. So far, I'm not impressed with it at all- the intellisense seems slow as hell, unconventional hotkeys (at least, compared to what I'm used to) and just all around I don't feel comfortable in the environment. Goons, why you do prefer one over the other?
|
# ¿ Nov 18, 2011 22:51 |
|
Can anyone recommend an easy-to-use UML-generating plugin for Eclipse? I really hate making the myself (or at least I just really hate Visio), but they're so helpful at times.
Sab669 fucked around with this message at 00:56 on Dec 1, 2011 |
# ¿ Dec 1, 2011 00:40 |
|
http://pastebin.com/cuTQJ4nU I've got an error on lines 96 & 97, it tells me I should change the type of myCar to InteriorColor / ExteriorColor respectively. But what I don't understand is Interior/ExteriorColor extend CarDecorator, which extend Car. This is for my design patterns class, doing a bonus assignment where we need to mix and match random patterns we've learned this semester, trying to use Decorator + Singleton patterns. But yea, no idea where my logic is wrong. As far as I can tell I've followed my previous homeworks exactly.
|
# ¿ Dec 14, 2011 05:40 |
|
I guess that's where I'm confused, because UniqueCar also extends Car, so isn't it technically a Car? And in the two classes I've taken that use Java as the language, I've never heard of Synchronized.
|
# ¿ Dec 14, 2011 06:12 |
|
Am I creating an array of objects incorrectly, or something?code:
code:
edit; I figured out my problem! I needed to add code:
Sab669 fucked around with this message at 04:12 on Mar 8, 2012 |
# ¿ Mar 8, 2012 04:02 |
|
C# guy trying to help my roommate with Java; are variables not referred to as "fields" in a class in Java? He's a first-semester CS student and his vocabulary is pretty poor, which makes it difficult when I try to give him guidance on a lab.
|
# ¿ Dec 9, 2013 19:41 |
|
Any recommendations on some absolute bare-bones First Programming Language books for Java? My roommate is going into his second semester of Comp Sci and he's really struggling. Decided to wait until the last week of vacation to buy a book and try to get back into it before the next semester starts Java, A Beginner's Guide seems to have good reviews.
|
# ¿ Jan 13, 2014 00:03 |
|
|
# ¿ Apr 23, 2024 22:58 |
|
Gravity Pike posted:Comp Sci II doesn't cover anything more complicated than, like, Generic Collections, right? It's been forever. His first semester class was actually pretty weird. They covered basic data types, then jumped into objects and interfaces then flow control and loops. They did a bit with ArrayLists as well, never having even talked about just basic arrays. By the end of the semester he barely comprehended the concept of 'returning' a value from a method, constructors, or creation of variables for things other than basic data types. I don't know if his professor sucked, or it was a lack of sufficient labs to give him practice or what.
|
# ¿ Jan 13, 2014 21:07 |