(The Triangle class) Design a class named Triangle that extends GeometricObject

You need to create a new Triangle object like this, so that you have a reference You also need to set it’s filled and color properties Then, you can invoke its methods like this: You’re able to access the GeometricObject‘s isFilled(), setFilled(), getColor(), and setColor() because a Triangle is a GeometricObject (extends), so it inherits all its methods. By the way, this is not how to calculate the area of a … Read more

How do you #include files in java?

You don’t #include in Java, you import package.Class. Since Java 6 (or was it 5?), you can also import static package.Class.staticMethodOfClass, which would achieve some forms of what you’re trying to do. Also, as @duffymo noted, import only saves you from systematically prefixing the imported class names with the package name, or the imported static … Read more

Java substring: ‘string index out of range’

I”m guessing i’m getting this error because the string is trying to substring a Null value. But wouldn’t the “.length() > 0” part eliminate that issue? No, calling itemdescription.length() when itemdescription is null would not generate a StringIndexOutOfBoundsException, but rather a NullPointerException since you would essentially be trying to call a method on null. As … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)