ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1720)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (43)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (195)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (145)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
how to call a method in different package?
 Question Submitted By :: Raaga
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to call a method in different package?
Answer
# 1
Import the package in to the class, where other package's
method is useful.
 
Is This Answer Correct ?    13 Yes 3 No
Sandhya.s
 
  Re: how to call a method in different package?
Answer
# 2
import fully Qualified name of the package in which the
method is present
use the method as "classname.methodname"
or
create the object of that package using a fullyqualifed
name of that package and use the method
as "object.methodname
 
Is This Answer Correct ?    10 Yes 0 No
Venkatachalapathy
 
 
 
  Re: how to call a method in different package?
Answer
# 3
import package in the class.That package related methods are now accessible in a class.If u want call a method
classname.method(); or create a new object to a class and then call the method like objectname.method();
 
Is This Answer Correct ?    2 Yes 0 No
Kiranksj
 
  Re: how to call a method in different package?
Answer
# 4
You Must import the package with fully Qualified name of
the class contains method.
Now you can call a method as:classname.method();
You can create a new object to that class and then call the
method as objectname.method();
 
Is This Answer Correct ?    2 Yes 5 No
Taresh Nama
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Ducking is automatic in checked exception?True or false   2
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod TCS 4
What is numeric promotion?   1
What is difference between Iterator and for loop HP 7
Differentiate constructor and a method and how are it be used? Wipro 6
What methods are called, When we navigate from one applet to another applet?   1
Explain Connection Pooling?   3
How u dubugg ur project? iFlex 1
what are Checked & Unchecked exceptions ?   2
Why to give the file name same as the public class name in java?   3
What is cloneable interface?   7
What for read() function?   3
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com