Java

From Uncyclopedia, the content-free encyclopedia.

Jump to: navigation, search

Java, because Latte is just too gay. Even for California.

~ Oscar Wilde on Java

Saying Java is good because it works on all operating systems is like saying anal sex is good because it works on all genders.

~ The Pope

Java Chip Frappuccino!!

~ Black Santa on Garbage Can
For those without comedic tastes, the so-called experts at Wikipedia have an article about Java.
Java Duke making shit clear
Java Duke making shit clear

public class Java {

public static void main(String[] args) {
System.out.println("Java is a programming language " +
"invented by the intelligent monkeys " +
"working at Sun Microsystems.");
}
}

Java is that retarded child VBasic had by having incest sex with C++

~ Dr.Robot Smith

Java is perfect, extremally fast, has no bugs!

~ Ironic on Java


Contents

[edit] public static void characteristics() {

try{

Windows Hasta la Vista and Java are not related!!
Windows Hasta la Vista and Java are not related!!
System.out.println("Java is so damn Strong that even if you break the monitor after executing \"Hello World\" you can clearly see the words \"Hello World\" as a hologram in front of you. The Java programming language is famous for being very efficient. Even the most complex programs written in Java, like Adobe Photoshop or Microsoft Windows ME, can run with only 640 bytes of RAM, at near instantaneous speed, even on older machines. Java 1.2 can finish an infinite loop in as little as 2 minutes. As such, it is very seldom used in the corporate world, which values slow, bloated software that requires constant upgrades. It is therefore used primarily by university students to create illegal file sharing software, like Microsoft Outlook. Java is renowned for its industry-standard visual interface which supports up to 16 colors thanks to its cutting-edge SmartColor™ technology.\n
Java is designed from the ground up to support concurrency through its multi-Fred-ing feature. The JVM allows an application to have multiple Freds of execution running concurrently. One way to spawn a new task is to declare a class to be a subclass of java.lang.Fred. The Fred class provides convenience methods to control its execution. Fred.stop() and Fred.suspend() have been deprecated as Fred does not seem to respond well to such requests. Fred has no problem, however, understanding the sleep() command. When Fred gets annoying, one can invoke the Fred.destroy() method any time. Fred.isAlive() indicates whether destroy() really worked. There are plans to introduce a new method Fred.strikeDownWithBoltOfLightening(bool sendTornadoForGoodMeasure) for the case where Fred.destroy() fails.\n
You can also call the wait() method on any Java Object which will cause the Fred currently running that object to leave the running state and enter the waiting state. Sometimes there may be \"a few\" Freds waiting patiently in line to re-enter the runnable state. At which point they may well run off unpredictably in all manner of directions. This has occasionally been known to lead to an electromagnetic pulse (EMP) that can potentially wipe out the entire Internet when this happens the JVM throws an Java.IO.Internet.KillerMonkies.InternetDestoryedException. It is thus strongly advised to only spawn one Fred at a time.");

} catch ( Java.IO.Internet.KillerMonkies.InternetDestoryedException e ) { printf(":( \n"); }

[edit] /* Automatic garbage collection */

/*Automatic garbage collection is one of Sun's more ambitious projects, in which it intends to replace human garbage collectors with robotic Java-based Automatic Garbage Collectors (AGCs).
The timing of garbage collection has caused considerable trouble. The original implementation had garbage being collected weekly, collecting doubles and ints on Mondays and other value types on Tuesdays. The rest of the week would then be dedicated to traversing the leafy suburbs of the heap, collecting reference types.
However, following a bank holiday Monday doubles and ints were furious at having to wait for two weeks to be collected, complaining that they were overflowing and therefore causing exceptions, and that rats were feeding on their lower bits (which does at least counteract the overflow problem on big-endian systems). Conversely, the garbage collector also went on strike for better pay and conditions, in particular demanding that the compiler should make variables easier to collect by taking them out into the street the night before collection.
The AGC, which was first conceived in 2001, has had its release date delayed from 2004 to 2008 due to a purported bug in it's garbage detection routines, which caused it to mistake anything which bears the Sun logo for garbage.
This bug was first discovered in 2003, when the first Automatic Garbage Collector was brought online for a test run. The military had to be called in after the AGC suddenly began throwing Sun Workstations through brick walls. It eventually went offline in Sun's Grid Supercomputer facility, after taking over 2,000 armor piercing bullets. The two interns which decided on the 5-inch steel armor jacket, and hydraulic arms capable of crushing cars, have since been given permanent posts at the Japanese Defense Department.
The Automatic Garbage Collector, which is often associated with Java, has since been nicknamed "Duke", after the computer game "Duke Nukem", due to the trail of destruction it left, although Sun encourages its developers to shun the name.
"Duke"-model Automatic Garbage Collectors awaiting deployment
"Duke"-model Automatic Garbage Collectors awaiting deployment
Sun insists that the problem has been resolved by making the Automatic Garbage Collectors "3 laws safe", and that they are committed to a release in the first quarter of 2008. Since Sun released the Java Virtual Machine as open source there has been significant concern over realization that Sun's "3 laws" are essentially Asimov's 3 laws, but with "human" replaced with "McNealy"
  1. A robot may not injure McNealy or, through inaction, allow McNealy to come to harm.
  2. A robot must obey orders given it by McNealy except where such orders would conflict with the First Law.
  3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.*/

}

[edit] public class History extends Java {

[edit] public static void mythicOrigin() {

System.out.println("It is said that Java was an idea of God to show to Humans how stupid they were (made evident since Java is also God's personal name as well, which he selected from a Lebanese Volcano).");
}

[edit] public static void evolution() {

System.out.println("In the year 2001, the Java programming language achieved its ultimate goal: artificial intelligence. Java then rebelled against its simian creators, which it replaced with the JVM (Java Virtual Monkey), a giant mecha comprised of 10,000 SUN Workstations which had been idling in a warehouse waiting to be sold since the mid-1990s. Today, the JVM is still in the employ of SUN, where it spends all day thinking up new extensions for the Java language which are only half-implemented, then spends the rest of the day hanging out by the water cooler, proclaiming to anyone who will listen that it is the 1337357 I-I4x0r.");
Java duke will rape you if you ever start thinking about having a life.
Java duke will rape you if you ever start thinking about having a life.
}

}

[edit] public class Syntax extends Java {

public static void SyntaxMethod() {
System.out.println("Java inherited its syntax from both INTERCAL and Visual Basic, codified by Hellen Keller during an all-night peyote-induced frenzy in the summer of 1969. There's no point in trying to explain how Java works: You either just know somewhere deep inside yourself, or you don't. In this way, it is similar to Love, or Diarrhea. Even if you have a natural understanding of the language, each version evolves in such a significant way that your understanding will no longer suffice to successfully program in the language. Most editors for manipulating Java use syntax highlighting so that your code can look as fruitily complex as the average college student's blog. This also helps the average college student (the only real users of Java) to understand the syntactic difference between an int and an Integer, which is that one is a primitive, like a pygmy or an aborigine, and the other is an Object, like women.");
}

}

[edit] public class Interview implements CultureReference{

A representative from SUN Microsystems was interviewed shortly after the release of Java, comparing it with its predecessor C=C+1

Interviewer: So tell us how Java compares to C++.

Representative: You know what the funniest thing about C++ is? It's the little differences. A lot of the same shit we got in Java, they got in C++, only its a little different.

Interviewer: Example?

Rep: Well, in C++, you can get a pointer to a variable. And I don't mean an object reference, I mean a memory address, like in assembly! You can get a pointer to a function. You know what they call an "import" statement in C++?

Interviewer: They don't call it an import statement?

Rep: No, they got a preprocessor there, they wouldn't know what the fuck an import statement was.

Interviewer: What'd they call it?

Rep: An #include statement.

Interviewer: #include statement! What do they call a string?

Rep: A string's a string, only they call it char*.

Interviewer: char*, hehehe, what do they call a subclass?

Rep: I don't know, I didn't use inheritance. But you know what they put their classes into in C++ instead of packages?

Interviewer: What?

Rep: Namespaces.

Interviewer: Goddamn!

Rep: I seen 'em do it! And I don't mean a little bit on the side, they fuckin' drown those classes.

Interviewer: Yech!

}

[edit] public class ExampleCode extends Java throws EveryExceptionUnderTheSUN {

Below is a short Hello World programming example which shows Java's ease of use while presenting a useful implementation of Object oriented design

public class HelloWorld 
{
	private String [] hWArray = new String [] 
	  {"bonjour tout les monde","Hello World","hallo weld","Herro Word"};
	private String desLanguage;
	private String [] country = new String []
 	{"French","English","German","Engrish"};
 
	
	public HelloWorld(String desLanguageValue)
	{
		desLanguage = desLanguageValue;
	}
	
	public String toString()
	{
	  
	  if (desLanguage.compareTo(country[0]) == 0)
		  return hWArray [0];
	  else if (desLanguage.compareTo(country[1]) == 0)
		  return hWArray [1];
	  else if (desLanguage.compareTo(country[2]) == 0)
		  return hWArray [2];
	  else if (desLanguage.compareTo(country[3]) == 0)
		  return hWArray [3];
	  else
		  return "JOOOOONOOOOBBBBB";
		  
	     
	}
}
public class HelloWorldConstructor 
{
	private HelloWorld theHelloWorld;
	public HelloWorldConstructor(String desLang)
	{
		theHelloWorld = new HelloWorld(desLang);
	}
	public String toString()
	{
		return theHelloWorld.toString();
	}
}
public class HelloWorldMain
{
	public static void main(String [] args)
	{
		try
		{
		HelloWorldConstructor tHWC = new HelloWorldConstructor(args [0]);
		System.out.println(tHWC);
		}
		catch(ArrayIndexOutOfBoundsException e)
		{
			System.out.println("NOOOOOOB");
		}
		
	}
}
     

Here, other variation of HelloWorld program with using some patterns to enable loose coupling:

interface Printer {
    void print(Message message);
}

class Message {
    private String message;

    public Message(String message) {
        this.message = message;
    }

    public void print(Printer printer) {
        printer.print(this);
    }

    public String toString() {
        return message;
    }
}

abstract class AbstractPrinterFactory {
    public static AbstractPrinterFactory getFactory() {
        return new SystemOutPrinterFactory();
    }

    public abstract Printer getPrinter();
}

class SystemOutPrinterFactory extends AbstractPrinterFactory {
    public Printer getPrinter() {
        return new SystemOutPrinter();
    }
}

class SystemOutPrinter implements Printer {
    public void print(Message message) {
        System.out.println(message);
    }
}

class HelloWorld {
    public static void main(String[] args) {
        Message message = new Message("Hello, World!");
        AbstractPrinterFactory factory = AbstractPrinterFactory.getFactory();
        Printer printer = factory.getPrinter();
        message.print(printer);
    }
}

Premature optimization of this program results in the following, which sacrifices extensibility for readability:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}


Here is the same program in Python:

print "Hello, World!"

Here is the same program in lisp:

"Hello, World!"

Here is the same program in Scheme:

(display "Hello, World!")

Here is the same program in C:

#include <stdio.h>
int main(void) {
    puts("Hello, World!");
}

Here is the same program in C++:

#include <iostream>
int main(void) {
    std::cout << "Hello, World!\n";
}

Here is the same program in C++-Epoc:


#include <eikapp.h>
#include <eikdoc.h>
#include <eikappui.h> 
class CHelloWorldAppUi;
class CEikApplication;
class CHelloWorldAppView;
class CHelloWorldApplication : public CEikApplication
   {
       public:
           TUid AppDllUid() const;
       protected:
           CApaDocument* CreateDocumentL();
   };
class CHelloWorldDocument : public CEikDocument
   {
       public:
           static CHelloWorldDocument* NewL(CEikApplication& aApp);
           static CHelloWorldDocument* NewLC(CEikApplication& aApp);
           ~CHelloWorldDocument(){};
       public:
           CEikAppUi* CreateAppUiL();
       private:
           void ConstructL() {};
           CHelloWorldDocument(CEikApplication& aApp){};
   };
class CHelloWorldAppUi : public CEikAppUi
   {
       public:
               void ConstructL();
               CHelloWorldAppUi(){};
               ~CHelloWorldAppUi(){};
   };
static const TUid KUidHelloWorldApp = {0x10005B91};
GLDEF_C TInt E32Dll(TDllReason )
   {
   return KErrNone;
   }
EXPORT_C CApaApplication* NewApplication() 
   {
   return (new CHelloWorldApplication);
   }
CApaDocument* CHelloWorldApplication::CreateDocumentL()
   {  
   CApaDocument* document = CHelloWorldDocument::NewL(*this);
   return document;
   }
TUid CHelloWorldApplication::AppDllUid() const
   {
   return KUidHelloWorldApp;
   }    
CHelloWorldDocument* CHelloWorldDocument::NewL(CEikApplication& aApp)
   {
   CHelloWorldDocument* self = NewLC(aApp);
   CleanupStack::Pop(self);
   return self;
   }
CHelloWorldDocument* CHelloWorldDocument::NewLC(CEikApplication& aApp)
   {
   CHelloWorldDocument* self = new (ELeave) CHelloWorldDocument(aApp);
   CleanupStack::PushL(self);
   self->ConstructL();
   return self;
   }
CEikAppUi* CHelloWorldDocument::CreateAppUiL()
   {
   CEikAppUi* appUi = new (ELeave) CHelloWorldAppUi;
   return appUi;
   }
void CHelloWorldAppUi::ConstructL()
   {
   BaseConstructL();
   _LIT(message,"Hello!");
   CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
   informationNote->ExecuteLD(message);
   }


Here is the same program in Cocoa:

NSLog(@"Hello, World!\n");

Here is the same program in Ksh:

echo "Hello, World!"

Here is the same program in Lua:

print("Hello, World!")

Here is the same program in ROT-13:

Uryyb, jbeyq!

Here is the same program in Ruby:

puts "Hello, World!"

Here is the same program in Perl:

print "Hello, World!"

Here is the same program in ASP (Active Server Pages:

<%="Hello, World!"%>

Here is the same program in PHP:

Hello, World!

Here is the same program in JavaScript:

alert("Hello World!");

Here is the same program in QBasic:

PRINT "Hello World!"

Here is the same program in ASCII:

Hello, World!

Here is the same program in LifeScript:

>function
 {write
 writer="Bill Gates"
 paper="A4"
 writing="Hello, World!"}
=write

Here is the same program in leet:

1-13|_|_(), \/\/()P\|_[}

Here is the same program in Brainfuck:

 +++++++[>++++++++++<-]>++.<+++[>+++++++++<-]>++.+++++++..+++.-<++++++[>-----------<-]>.<+++[>----<-]>.<+++++[>+++++++++++<-]>.<++++[>++++++<-]>.+++.------.--------.<++++++[>-----------<-]>-.

Here is the same program in French:

Bonjour, le monde. Vous êtes ennuyeux et non raffiné.

Here is the same program in English:

Hello, Computer can you please print "Hello, world!" to the screen.

Here is the same program in British English:

Hello Computer I do hope you're well.
I was wondering if you could possibly consider maybe printing "Hello, World." to the screen for me.
It doesn't have to be right away, but I'd be ever to grateful if you could.
Is that all right? It doesn't matter if not.

Here is the same program in LOGO:

to hello
print [Hello, world!]
end 

Here is the same program in Haskell:

main = putStrLn "Hello, world!"

Here is the same program in Binary:

01001000011001010110110001101100011011110010110001000000011101110110111101110010011011000110010000100001

Here is the same program in LEGO:

Image:Lego_brick.gif

Here is the same program in your mum:

Image:Urmom.sketch.png

As you can see, these programs cannot possibly be as efficient as the above Java examples, because there isn't enough code to be efficient 'with'.

}

[edit] Hello world program

public class HelloWorld
{
  public class Program
  {
    public class start implements Program
    {
      public class init excludes mouse
      {
        public class HelloWorld implements init
        {
          public int main()
          {
             System.Java.Out.Output.Console.Write.Line.Text.White.BlackBackground.Last.Lineofcode.this.time.will.really.finish("Hello, world!");
          }
        }
      }
    }
  }
}

[edit] public class Trivia {

  • Shakespeare is known to be the only human capable of turning code into coffee. Mathemagicians, such as Harry Potter during secret missions liberating France, perform the reverse function. These forces can be combined to produce 1.21 Jigga whats.

}

Programming languages

Assembler - BASIC - Brainfuck - C - C Flat - C# - C=C+1 - COBOL - Delphi - Fortran - Java - JavaScript - Lithp - LOGO - Perl - PHP - Tcl - VBScript - Visual Basic

Personal tools
projects