Java Question

Respected Sir,if i writeSystem.out.println("Hello World"); //okbut sir if i want to write Test.out.println("Hello World");where Test is a user-defined class. How shall i write the proper code sir?please sir give me the actual code.Thanking You,Anirban Sinha.
[279 byte] By [anirbana] at [2007-11-27 5:30:10]
# 1
> where Test is a user-defined class. How shall i write the proper code sir?I'm confused: the code for implementing Test.out.println() or the code for calling this method?
quittea at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...
# 2

To repeat the answers given [url=http://forum.java.sun.com/thread.jspa?threadID=5176168&messageID=9680910#9680910]yesterday[/url].

1) Please write a better subject. What does "Java Question" tell us about your question? We know it is doing to be a question, that is the point of the forum. We are also aware that it will concern Java, as again that is the point of the forum.

2) What do you think the code should be? Why? Does it work? No, post it.

You might want to lay of the "Respected Sir" stuff. Ask a decent question, you will get decent replies.

mlka at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...
# 3

you could have within class Test an inner class like this:

public static class OutWriter{

public static void println(String msg)

{

System.out.println( msg);

}

}

Test would need a

public static OutWriter out = new OutWriter();

simon_orangea at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...
# 4
public class Test extends System {}But you can't do this because the System class is declared as final. Well, I guess you could since Java is open source now, but why would you want to?
robpaynea at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...
# 5
> > You might want to lay of the "Respected Sir" stuff.I believe he was addressing me!
ScarletPimpernela at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...
# 6

> >

> > You might want to lay of the "Respected Sir"

> stuff.

>

> I believe he was addressing me!

I believe he was, yes. He was talking about this "Respected Sir" yesterday, too. Apparently you're buying everyone a drink or something. Cheers

georgemca at 2007-7-12 14:53:59 > top of Java-index,Java Essentials,Java Programming...