File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes java appl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java appl" Watch "java appl" New topic

java appl

Rajeev Kadam

Joined: Nov 10, 2003
Posts: 1
can we write a java application without main which prints message on console
using System.out.println()??
Michael Yuan
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
no a j2me question. move to JiG (beginner).

Seam Framework:
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

How do you write a java application without a main method? Are you talking about an applet?
In any case, I don't think that this is a possibility. If you somehow start your application through a means whereby it does not have a console window, you will have to redirect your System.out calls to have it display wherever you want. In order to diplay to a system console, you would have to know which console and other bits of system-level information that Java does not provide.
You could, of course, write your own console class and have the data directed there.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
I agree. Here's the link:
subject: java appl
jQuery in Action, 3rd edition