Hi myth,

Answer on Q1 :
The variable  out is an static variable, this means that for all
instances of System there is only one out variable (all instances of
System have a pointer to the same adress in memory on wich out is
stored). You can thus call System.out.println() and it will print a
message to the screen.


Answer to Q2 :
When you call getAppletContext you will get an implementation of the
AppletContext wich is an actual object.

For example if you have a List of Person objects but the persons can be
Students, Teachers and SupportingEmpoyees you can create an interface
Person wich defines all the methods a person should have. And then let
Student, Teacher and SupportingEmployee implement this interface and
give
each class a different implementation of the methods listed in Person.
You can then add different objects(Teachers,Students and
SupportingEmployees) to the PersonList class and operate on them with
the methods defined in Person.

I think you should read the trial Learning the Java Language in the Java
Tutorial
wich explains the concepts about java.
Further more Thinking in Java is a very good book to learn to program in
Java
(and better it's free available online somewhere)

Greetings Wim Veninga

myth wrote:

> hi
> I am new to Java(about 6 months in it).
> i have few doubts and think you masters can help me.
>
> Question 1.
> The doubt is about System.out.println()
> System is a class and out is a variable in System
> class.
> println(),print() are in PrintStream class.
>
> a.how can you call println in System class.
> b.System.out.println() is like this,
>   ClassName.variable.methodname(),how can you call
> like this.
>
> Question 2.
>
> AppletContext is an interface.you cannot create
> objects of interface.
> but when you call getAppletContext() method you get an
> object of the interface.How is this possible.
> In RMI also i saw a method which will give an object
> for an interface.
> how is it possible.
> please find time to clear my doubts(i did study thoery
> in more than one book and didnot understand).
> regards
> Srivatsan.
>
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/


Reply via email to