+ 1
How can I access a class from another class of same package?Both classes are defined beginning with package keyword.
I have tried importing the class and calling directly. But that does not work.
4 Respuestas
+ 1
Post the code for a better answer
+ 1
package AHA;
public class CLASS1{
public static void main(String args[])
{
System.out.println("WELCOME SRAJAN...........");
CLASS2 g=new CLASS2();
}
}
+ 1
package AHA;
public class CLASS2
{
public CLASS2()
{
System.out.println("Welcome Srajan");
}
}
+ 1
above two are the codes of two .java files