hi, am a newbie java programmer
as we know that when we want to print anything on console
System.out.prin tln is used
but i want to instantiate the system class such that i can write the code as
System.obj1.pri ntln("hello world")
is there any way to do that
i wrote a sample code but it is not working
but i am getting an error
The constructor System() is not visible
obj1 cannot be resolved or is not a field
please help, if there is any way to do that please tell me
thanks in advance
siddarth
as we know that when we want to print anything on console
System.out.prin tln is used
but i want to instantiate the system class such that i can write the code as
System.obj1.pri ntln("hello world")
is there any way to do that
i wrote a sample code but it is not working
Code:
class helloworld { System obj1=new System(); System.obj1.println("hello world"); }
The constructor System() is not visible
obj1 cannot be resolved or is not a field
please help, if there is any way to do that please tell me
thanks in advance
siddarth
Comment