File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To clear the basic fundamental

 
dimple bav
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it is very silly but i just want to clear the funda:

what is the difference between code1 and code2

code1:

class A
{
}

class test
{
public static void main(String args[])
{
A a = new A();
}

---------------------------------------------------------
code2

class test
{
public static void main(String args[])
{
Test a = new Test();
}

Thank you.
Dimple.
 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you want to know?
 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the first you are creating an instnce of class A...and in 2nd you are creating an instance of Test class
 
dimple bav
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raju Champaklal wrote:what do you want to know?


But in the code 1 hows the instance of class A is related to Test class
 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
since both are in same packages an instance of A class can be created anywhere within the same package or within any class in the file....
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic