[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Pure Angst

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 3

//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
>>
File: 1421137315541.jpg (6KB, 255x98px) Image search: [Google]
1421137315541.jpg
6KB, 255x98px
>>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
Thread posts: 10
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.