#This code seems wierd, or i'm missing something but what's wrong with this

1 messages · Page 1 of 1 (latest)

onyx dagger
wary hareBOT
#

<@&987246399047479336> please have a look, thanks.

wraith skiff
#

You just have a lot of syntax errors and they explain them selfs. Method dont exist. On exception u need to put a new keyword in between the throw and Class

wary hareBOT
#

In Java, an abstract method is a method that is declared in an abstract class or interface but does not have an implementation. Abstract methods are meant to be overridden by subclasses or implemented by classes that implement the interface.

To declare an abstract method in Java, you use the abstract keyword before the return type of the method. For example:

public abstract class Shape {
    public abstract double calculateArea();
}

In this example, the calculateArea() method is declared as an abstract method in the Shape class. Subclasses of Shape must provide an implementation for this method.

It's important to note that a class containing one or more abstract methods must also be declared as abstract using the abstract keyword. You cannot create instances of an abstract class directly, but you can create instances of concrete subclasses that provide implementations for all the abstract methods.

Abstract methods are useful for defining a common interface that multiple classes can implement in their own way. They help enforce a contract between classes and provide a way to ensure consistency in behavior across different implementations.

wraith skiff
#

Without the new keyword the compiler sees ur IllegalArgumentException as a method. To say that this is intended to be a constructor u need the new keyword

#

And you cant have methods inside of methods