java tricks

R

raski

i was wondering if any of you guys would know any trick i could
pull on some of my friends on a java based chat room. nothing harmful, only
for playing around...

www.iskon.hr/chat/chat.jsp

that's the link. i would be thankful if you could mail me some...

Thanx in advance
 
S

Stefan Ram

raski said:
i was wondering if any of you guys would know any trick i could
pull on some of my friends on a java based chat room. nothing
harmful, only for playing around...

The following program will print »Hello!«.

public class Hello
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println( "Hello!" ); }}

This trick works by exploiting the JLS and the Java-API,
forcing the JVM to print »Hello!«. Both the Java Security
manager and the Java "sandbox" usually will not prevent this
to be actually executed!

But be careful: The text will be printed /immediatly/ as soon
as the program is started, there will not be a prior warning
or a an inquiry. So, you might not try this at home. But
possibly you could fool your friends in the chat room into
compiling and running it? That would be fun! I'd like to see
the baffled look on their faces when suddenly out of the blue
the text »Hello!« appears on their screen.

Even more cool: The text »Hello!« can be replaced by any other
text, in order to print that other text. So it is great for
playing around. Just give it a try!
 
J

James McGill

public class Hello
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println( "Hello!" ); }}

Do you realize that causes the JVM to exit as soon as the static
function completes?!
 
B

Bart Rider

Stefan said:
raski said:
i was wondering if any of you guys would know any trick i could
pull on some of my friends on a java based chat room. nothing
harmful, only for playing around...


The following program will print »Hello!«.

public class Hello
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println( "Hello!" ); }}

This trick works by exploiting the JLS and the Java-API,
forcing the JVM to print »Hello!«. Both the Java Security
manager and the Java "sandbox" usually will not prevent this
to be actually executed!

But be careful: The text will be printed /immediatly/ as soon
as the program is started, there will not be a prior warning
or a an inquiry. So, you might not try this at home. But
possibly you could fool your friends in the chat room into
compiling and running it? That would be fun! I'd like to see
the baffled look on their faces when suddenly out of the blue
the text »Hello!« appears on their screen.

Even more cool: The text »Hello!« can be replaced by any other
text, in order to print that other text. So it is great for
playing around. Just give it a try!
*lol*
:p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

java chat 4
java tricks 2
java based chat 2
Understanding Inheritance and Polymorphism 1
For an online game. 0
Java vs JavaScript 24
Access SNMP using Java 11
nimsg -- the Network Instant MeSsenGer 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top