class A { // some code here} class B { // some code here}class Ex {public static void main(string args[]) {A a=new B();B b=new A();a.add();b.add();}Will this program run? Explain the referencing the object
Latest Answer: No it will not compile - as A does not extend B nor vice-versa when you try to assign an object of type B to a reference of type A (and vice-versa) you will get an 'Incompatible type' error message from the compiler! If inheritance were involved ...
We have a small requirement where we need to retrieve the e-mail ids of all the employees in the distributed list using LDAP, can any one give an idea how it can be done?
Latest Answer: Hey did you got answer for your query? i too is in requirement of answer for your query.infact, my requirement is "how to access and display the contacts in a distribution list using java?" ...
Latest Answer: try this piece of code: java.net.InetAddress remoteInetAddress = java.net.InetAddress.getByName(request.getRemoteHost()); String client=remoteInetAddress.getHostName(); System.out.print(client); ...
What is wrong in the following code?pulic synchronized void setXXX(String s){ this.setXXX(s);}public synchronized String getXXX(){...}orpulic synchronized void setXXX(String s){ return (this.getXXX());}
Latest Answer: to create word doc use MIME type "application/msword"ORuse POI ,is an open source apache project to create, read ms office file formati.e .doc, .xls, for more info visit poi . apache . org/ ...
Latest Answer: The answer given is absolutely right along with that we also say the following1. Static variable has only one copy for all the methods in class while instance variable has many copy.2. Class can access only static variable while object can access both class and instance variable. ...
Latest Answer: Dictionary Class ...
Latest Answer: this method is used to tracing the instance in your application. Which instance is running of the class. ...
Which is the most convient way to create a thread and Why?1) Extends from thread or2) Implements from Runnable Interface.
Latest Answer: Assertions are kind of mechanisms in java from 1.4 onwards, where assert is a keyword. By using assertions you can validate your assumptions. Assertions should be only used to validate certain assumptions. Assertions should:1. Be used to assertain the ...
View page << Previous 1 2 [3] 4 5 6 7 8 9 10 Next >>

Go Top