Preskočiť na hlavný obsah

Príspevky

.Net vs. Java programmers Joke

A group of 4 Microsoft .NET programmers and a group of 4 Java programmers are going on a train to an expo. The MS programmers buy a ticket each, and then watch the Java programmers proceed to buy one ticket between them. The MS programmers are intrigued and when they get on the train, they watch the Java programmers to see what they do when the guard comes to check the tickets. It turns out that, before the guard comes, they all cram into the toilet. The guard knocks on the door, and asks for the ticket. The guard takes it from under the door, and slides it back. The MS programmers are all impressed, so on the way back, they buy only one ticket. Only to watch the Java folks get on the train without buying a ticket at all. When they get on the train, the MS people cram into the toilet, as they saw the Java folks on the earlier journey. The Java programmers then knock on the door, and say "Ticket please". The MS programmers slide the ticket under the door, as they saw the...

Java Exceptions Joke

A bunch of 17 year olds - ClassCast, IllegalArgument and ArrayOutOfBounds - decide to take their chances, and try to get served at the bar. The Bartender takes one look at them, and asks them for ID. ClassCast hands over his fake ID, IllegalArgument hands over his brother Throwable's ID, but ArrayOutOfBounds doesn't have any fake ID. The Bartender says "Sorry guys, you'll have to leave unless I can see some ID". ClassCast pleads with the barman "can't you just bend the rules for us?" and the barman says "Sorry, no Exceptions".

StringBuffer vs StringBuilder

The String class is the most popular class in Java, especially in Web application development where it is used massively to format HTML output. String is designed to be immutable. In order to modify a String, you have to create a new String object. Therefore, string concatenation can result in creating many intermediate String objects before the final String can be constructed. StringBuffer is the mutable companion class of String. Therefore, StringBuffer is generally more efficient than String when concatenation is needed. Unfortunately it uses synchronized methods. If you are working in a multi-threaded application where you would have to worry about thread safety and synchronization, you should use StringBuffer (or Vector, or HashTable). But if you are in a single threaded application, or one in which thread management is safely handled by an external resource, then the non-synchronized version is a better choice. StringBuilder is a relatively new addition to Java, introduced in JDK...

Java je viac ako jazyk

Popri tom, že je Java objektovo orientovaný programovací jazyk, môžeme dnes s určitosťou tvrdiť, že sa Java stala "technológiou". Zámerom Javy bolo poskytnutie platformovo nezávislého programovacieho jazyka pre spotrebnú elektroniku. Ako však dnes vidíme, Java sa nedostala do "toasterov", ale do našich web browserov. Existuje niekoľko teórií o pôvode mena tohoto jazyka. Na začiatku (1991) sa pracovne volal "Oak", tento názov bol však v tom čase už registrovaný. Neskôr, vraj podľa "kofeínového" nápoja obľúbeného u hlavných návrhárov jazyka, dostal definitívne meno Java. Javu predstavila firma Sun Microsystems oficiálne prvý krát 23. mája 1995 a od vtedy sa stala jedným z najpoužívanejších programovacích jazykov. Vďaka svojej jednoduchosti, bezpečnosti a prenositeľnosti je Java používaná pre programy, ktoré majú pracovať na rôznych platformách od jednočipových systémov, cez mobilné zariadenia, desktopové aplikácie, až po rozsiahle distribuované sys...