print hello world without main method in java
Page 1 of 1 • Share •
print hello world without main method in java
Guys,
can you write a java program which print "hello world" but there will be no main method in you program..?
You may seem, Im going to be mad, but fact is that, I've already written a java program which can print something without having main method.
Better try..
cheers!!
can you write a java program which print "hello world" but there will be no main method in you program..?
You may seem, Im going to be mad, but fact is that, I've already written a java program which can print something without having main method.
Better try..
cheers!!
_________________________________________________________________
Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী

BIT0112-Rokon- Programmer

- Course(s):
- BIT
Blood Group: O+
Posts: 673
Points: 1269

Re: print hello world without main method in java
bit0112-rokon wrote:Guys,
can you write a java program which print "hello world" but there will be no main method in you program..?
You may seem, Im going to be mad, but fact is that, I've already written a java program which can print something without having main method.
Better try..
cheers!!
aswani44- Pre-Alpha Release

- Course(s):
- N/A
Blood Group: NULL
Posts: 2
Points: 2
Re: print hello world without main method in java
??
_________________________________________________________________
Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী

BIT0112-Rokon- Programmer

- Course(s):
- BIT
Blood Group: O+
Posts: 673
Points: 1269

Re: print hello world without main method in java
- Code:
public class PrintHello{
static{
system.out.println("Hello");
System.exit(0);
}
}
Last edited by BIT0122-Amit on Mon Nov 15, 2010 2:28 pm; edited 1 time in total (Reason for editing : please use the code tag when giving codes.)
aswani44- Pre-Alpha Release

- Course(s):
- N/A
Blood Group: NULL
Posts: 2
Points: 2
Re: print hello world without main method in java
aswani44 wrote:public class PrintHello{
static{
system.out.println("Hello");
System.exit(0);
}
}
nice, nice work.
The post was given, when I was learning Java first time, and it was something really funny and interesting ....
btw thanks ...
_________________________________________________________________
Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী

BIT0112-Rokon- Programmer

- Course(s):
- BIT
Blood Group: O+
Posts: 673
Points: 1269

Re: print hello world without main method in java
Rokon, please ensure that people use the code tag when giving codes ^_^
_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.
|About me|My Blog|

BIT0122-Amit- Founder

- Course(s):
- BIT
Blood Group: O+
Posts: 4187
Points: 6601

Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Active Topics!

» Understanding Timestamp Based Protocol
» Hi from Newbie
» Compare an image from a list of images in the sql database....tell which image is matching
» Sending email without email ID
» teach yourself c by herbert schildt pdf
» .NET MVC3: Unable to find the requested .Net Framework Data Provider. It may not be installed.
» SAD Slides: 4.1, 4.2
» QA topic Presentation - Urgent Notice