• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java appl

 
Rajeev Kadam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we write a java application without main which prints message on console
using System.out.println()??
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no a j2me question. move to JiG (beginner).
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic