//private fields of the class
private String species;
private final int name;
//static variable to keep count of objects
private static int monsterCount = 0;
public Person(int = monsterSpecies, int myName){
species = monsterSpecies;
name = myName;
monsterCount++;
}
//This is an instance method
public void setSpecies(String monsterSpecies){
species = monsterSpecies;
System.out.println("This user is now a "+species);
}
//this a void method
//does not return anything
public void printSpecies(){
System.out.println("Species: "+species);
}
/*this is static method, again*/
public static void getMonsterCount(){
String add = "been created.";
System.out.println(monsterCount==1? monsterCount+" person has "+add:monsterCount+" monsters have "+add);
}
public static void main(String[] args) {
//create a new object, obviously a monster for the funsies
Monster me = new Monster("Mike Wazowski", 1);
me.printSpecies();
me.setSpecies("Memes");
me.printSpecies();
Monster.getMonsterCount();
Monster another = new Monster("Donald Trump", 2016);
Monster.getMonsterCount();
}
}
So, anyone else got perfectly good Java Code that the compiler doesn't accept as real?
I know what you did wrong but since youre an SUfag im not gonna tell you.
>>52534731>REEEEEEEEE
>>52534731
back to dumblr, you stupid jew nigger retard faggot
>>52534731
It won't compile because you forgot to put
//this is a static method
over main.
But for real what's up with those comments?
>>52535608
Nothing wrong in watching cute lesbian rocks.
Eh, mandatory. It's part of an extra-college-credit thing because I kind of fucked up adding up credits.
Also, it was either that picture or this. And those are literally only pictures I've saved on my computer thus far. (Had it for 5 years. Whoops)
>>52535735
Fuck did I really forget to click the reply to button? No wonder I fucked up this code
>>52535899
>>52534731
ah thanks i need to catch up.
It's not that hard to debug code yourself you know, it looks to me like the signature to your Person constructor is a little fishy