0

I have created a runnable jar file with a JSON Object "J" as return type in a method A() of Class A. JSON Obj was in a package a.b. Now my question is that, When I import the jar in any other project the return type JSON obj needed to be placed in the same package path(i.e., a.b) provided in the jar.Else compile error occurs if the path is changed something like a.b.c.json. Am I following the correct procedure to retrieve JSON object or else is there any other procedure??

 Class A{
   public Json A(){
     return Json;
   }
 }
αƞjiβ
  • 3,056
  • 14
  • 58
  • 95
Himaja
  • 1
  • 1
  • 1

1 Answers1

0

Seems like you have a Class definition like:

class A {
  public Json call() {}
}

This means that the class A is not visible outside it's package, because its visibility is package private. Change it to something like public class A, and you should be able to use it in other places.

Also, please note that the class name should be (by general convention) a constructor.