Wed Feb 04, 2009 12:48 am
package CurveOr;
import CurveIT.HasStaticMember;
public class UsingStaticImport {
public static void main(String[] args) {
System.out.println(HasStaticMember.limt);
}
}
package CurveIT;
public class HasStaticMember {
public static int limt=100;
}
package CurveOr;
import static CurveIT.HasStaticMember.limt;
public class UsingStaticImport {
public static void main(String[] args) {
System.out.println(limt);
}
}
}
import static CurveIT.HasStaticMember.limt;
package CurveIT;
public class HasStaticFunction {
public static void println()
{
System.out.println("I am HasStaticFunction");
}
}
package CurveOr;
import static CurveIT.HasStaticFunction.println;
public class UsingStaticImport {
public static void main(String[] args) {
println();
}
}
import static CurveIT.HasStaticFunction.println;
package CurveIT;
public class HasStaticMember {
public static int limit=100;
public static void setLimit(int newlimt)
{
limit=newlimt;
}
}
package CurveOr;
import static CurveIT.HasStaticMember.*;
public class UsingStaticImport {
public static void main(String[] args) {
setLimit(43);
System.out.println("Limit is"+limit);
}
}
Limit is 43
Wed Jun 12, 2013 5:14 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.