Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA architecture

 
rexjonathan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear friend,
I am asking you to some basic JAVA architecture qustion
The question is ,
I am designing an applet ,where i want to display an message in applet say �hello� ,so i use Graphics class to display the string ,the code is
Line1:Graphics g=getGraphics();
Line2:g.drawString(�hello�,10,10);
Or
Public void paint(Graphics g)
{
g.drawString(�hello�,10,10);
}
my question is-�how it is possible without creating instance of Graphics class to call a method drawString() ,people say that the reference to the Graphics class is produced if it�s true please explain me how the refrence is passed and how it is working�
rex

 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't post the same question to more than one forum. You obviously read more than one forum, and so do people who might know the answer to your question. All answers to the one in "Java in General, (beginner)" please.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic