Hello everyone...
For now i have build a Human class and i want to test it now but on 2 lines there is an error and both errors states "void expected".
I have a main function in my class but later i gonna remove it because i want this Human class later to be a Superclass and a warrior, mage and so on will be a subclass that inherits everything what i got so far in my Human class.
Errors are on line 13 and 32
Here are the codes.
import java.util.*;
public class Human {
public static void main(String[] arguements) {
Scanner CharSet = new Scanner(System.in);
String name;
int strength, health, intelligence, agility;
public void MyChar() { //On this line is a error
System.out.println("Enter your Name: ");
name = CharSet.next();
System.out.println("Enter your Strength: ");
strength = CharSet.nextInt();
System.out.println("Enter your Health: ");
health = CharSet.nextInt();
System.out.println("Enter your Intelligence: ");
intelligence = CharSet.nextInt();
System.out.println("Enter your Agility: ");
agility = CharSet.nextInt();
}
public void Reveal() { //On this line is a error
System.out.println("I am " + name + ". ");
System.out.println("My Strength is " + strength + " my Health is " + health);
System.out.println("My Intelligence is " + intelligence + " and my Agility is " + agility);
}
}
}
Hope you can help me with that...