wood burning stoves 2.0*
The moose likes Meaningless Drivel and the fly likes Funny Codes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Funny Codes" Watch "Funny Codes" New topic
Author

Funny Codes

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Let's see who can write the funniest code. Here's mine



(If any one says that bunks field is not initialized or girls variable is never declared, I'll kill him/her)


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
I think it's better if you can move this topic to here
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If any one says that bunks field is not initialized or girls variable is never declared, I'll kill him/her

No, I was about to say that girls will never be cute comparing them with "==" instead of equals()


[My Blog]
All roads lead to JavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
No, I was about to say that girls will never be cute comparing them with "==" instead of equals()

So you're saying girls are like strings?


Ping & DNS - my free Android networking tools app
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
It's ok, but don't forget to call Garbage Collector System.gc(); inside the while(girls == "Cute") loop.

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

No one saw that it's an endless loop. That's because girls are always Cute
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Originally posted by Ankit Garg:
No one saw that it's an endless loop. That's because girls are always Cute


Then replace == with =

[ December 13, 2008: Message edited by: Treimin Clark ]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Originally posted by Treimin Clark:


Then replace == with =



But then the code will not compile as the expression will not be a boolean expression
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Originally posted by Ankit Garg:

But then the code will not compile as the expression will not be a boolean expression


Aaaaaa! Did you mean that the existing code will compile?
Are you really talking about programming

Hope you like boolean girls
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Fortunately, it's not that simple. If you check the API, you will see that Person (superclass of Boy and Girl) has a getCuteness(AccessLevel a) method that returns a unique CutenessProperties instance based on the caller's access level. Once you have this, you need to analyze the attributes using an instance of your own (private) Evaluator, which employes a virtual chaos emulator to generate a subjective realtime indicator. The entire process is typically a daemon thread looping in the background, and it cannot be interrupted. Note that these are native methods, so their behavior is platform dependent. This might seem like a complex pattern, but if you don't follow it, you're likely to serialize a shallow copy, which will eventually cause your system to crash.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Hope you like boolean girls

Never met one, but I think they'd make life less enjoyable, even if at times a little easier.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

Fortunately, it's not that simple. If you check the API, you will see that Person (superclass of Boy and Girl) has a getCuteness(AccessLevel a) method that returns a unique CutenessProperties instance based on the caller's access level. Once you have this, you need to analyze the attributes using an instance of your own (private) Evaluator, which employes a virtual chaos emulator to generate a subjective realtime indicator. The entire process is typically a daemon thread looping in the background, and it cannot be interrupted. Note that these are native methods, so their behavior is platform dependent. This might seem like a complex pattern, but if you don't follow it, you're likely to serialize a shallow copy, which will eventually cause your system to crash.



Watt?!!!

Is that a general "advice" or your idea of a funny code?



[List of FAQs] | [Android FAQ] | [Samuh Varta]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You keep using that word. I do not think it means what you think it means.


[Jess in Action][AskingGoodQuestions]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

This whole conversation smells like geeky now
Arvind Mahendra
Ranch Hand

Joined: Jul 14, 2007
Posts: 1162

how I felt after reading Marc's code


I want to be like marc
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Originally posted by Arvind Mahendra:
how I felt after reading Marc's code


It's not Marc, it's marc (shiftless )
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

Originally posted by Ulf Dittmer:

So you're saying girls are like strings?


Or maybe they come with Strings Attached
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

I'm soooo waiting for one of the female ranchers to wander in on this conversation <reaches for popcorn>.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
permaculture playing cards
 
subject: Funny Codes