ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Package1 and Package2 both have a method name lets say
"methodA" with different implementation. When I import both
the packages in a java class how can I use both the methods?
 Question Submitted By :: Manub22
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
Answer
# 1
//import like this:

import Package1.class
import Package2.class

//use it in your class
class yourclass
{
  class.methodA(); // Package1 method call
  class.methodA(); // Package2 method call
}
 
Is This Answer Correct ?    4 Yes 7 No
Shiv
 
  Re: Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
Answer
# 2
// Do you want to say like this?

//import like this:

import Package1.classA
import Package2.classB

//use it in your class
class yourclass
{
  classA.methodA(); // Package1 method call
  classB.methodA(); // Package2 method call
}
 
Is This Answer Correct ?    6 Yes 2 No
Manoj
 
 
 
  Re: Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
Answer
# 3
You can not call a method like above unless untill ur 
classes are static. 
       You can create instance and u can use as

Instance.method();
 
Is This Answer Correct ?    9 Yes 0 No
Sriragv
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is the life cycle of jsp? Photon2
explain the clone method and clonable interface  1
explain about casting of objects?  4
write a class to input 2 points by the user & check the line maked by the points is horizontal,vertical or rectangle?  1
Difference between Web-based applications,Client- Server applications and Distributed applications? Infosys2
what is the use of finalize()Method please explain with an example  2
What is Collection interface? Zensar1
Define interface?  2
how to call One constructor from another; Innodata-Isogen7
is there any function in java to make the text to blink?  5
How are this and super used?  6
Why we use static and synchronized in method for single thread model example: public static synchronized add(){}  1
How are commas used in the initialization and iteration parts of a for statement?  2
please tell me what is wrapper class in java with example ?  3
Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thread tries to access a particular resource we can lock the method using synchronized keyword. Then after that how the lock is released and how next thread access that.Please explain with example.  1
How many objects are created for a singleton class Ness-Technologies4
Why null interfaces are used in Java?  2
What is JIT ? Satyam4
Difference between Hash Table and Hash Map? Persistent7
what is the purpose of class "Object" which is base class for all classes?  3
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com