Hi! ALL, send Test
__ ==ÐÂÀËÃâ·Ñµç×ÓÓÊÏä http://mail.sina.com.cn ÐÂÀËÍƳö°ÂÔ˶ÌÐÅÏ¢ÊÖ»úµã²¥·þÎñ http://sms.sina.com.cn/
hi all
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/
Re: hi all
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/
Re: hi all
Question 1. The doubt is about System.out.println() System is a class and out is a variable in System class. Yes - a public static one, which means: a) The world can use it. b) When the world wants to use it they prefix the name of the owning class rather than an instance reference. a.how can you call println in System class. println() is not in the System class, it is in the PrintStream class. You are accessing System's public instance, which by default is wired to 'the screen'. 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. You are getting an implementation of the interface, an object instantiated from a class definition that implements this interface. You see this object from the point of view of the interface type reference. In RMI also i saw a method which will give an object for an interface. how is it possible. For the same reason as above. This is a common way of cutting down on implementation dependencies within systems. You define an interface (e.g. 'public interface Plok' instead of 'public class Plok'), containing a set of method signatures but no method bodies. It is possible then to swap (even 'hot-swap' at run time) implementations (e.g. from IBM, Sun, Netscape) without breaking the rest of the code. It takes a while to fully grasp the potential of this, one of the most powerful feature of the Java language. MD
RE: hi all
I am new to the Orion world and I wasn't sure if my first question got to the group. I need to convert some static HTML pages from an old server and add them to the Orion server. One includes a Perl CGI script. 1. In order to add the HTML pages, should I follow the examples in the Orion primer and just leave out everything relating to Servlet, EJB, etc., in the XML configuration steps? 2. Can I follow the FAQ for PHP and just substitute Perl instead? 3. When I set the server up the first time, should I edit the XML file, server.xml, showing domain name and IP address Since I am new to this, I would appreciate any help or suggestions. -Original Message- From: myth [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 7:07 AM To: Orion-Interest Subject: hi all 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/