i love you not because who you are but because who i am when i'm with you
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
but then what would be the difference between instantiating A and creating a reference to A i.e option 1 & 2
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan Muthu:
But the OP has posted only with the constructor with default visibility. Thats where the question started off.
3.The class A cannot be extended outside the package in which it is defined.
it seems like I have to read the questions and answers more carefully
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
SCBCD, SCJP & MCP
HowToAskQuestions
1.The class A can be referenced outside the package in which it is defined.
2.The class A cannot be instantiated outside the package in which it is defined.
3.The class A cannot be extended outside the package in which it is defined.
4.The class A can be referenced, instantiated or extended anywhere.
5,The above code will cause a compiler error. The constructors of public class have to be public.
Originally posted by raj malhotra:
class A can be referenced outside the package if we import the class in other package and its constructor is public. which is not the case so this is not the answer.
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
1.The class A can be referenced outside the package in which it is defined.
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Always! Wait. Never. Shut up. Look at this tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|