I am trying to use static import with my code,
the problem is that i cannot use static import for my created custom class but with Java package static import works as designed so just a Question does static import works only with Java packages or is it customizable with custom java files used in project.
If yes then is there any coding structure i am missing while creating my custom java files so as to include them as static import.
What does your code look like? Do you get error messages when you try to compile it? Please copy & paste the exact error messages. The more detailed information you give us, the better we can help you. Right now you've told us too little to answer your question.
Sun (Oracle now) has made an extra hard effort at not differentiating the sun packages(shipped with the jdk) and the classes which you write. If you look at the source of openjdk, every class is the same, regardless of whether it was written by you or by sun. So any rule which applies to your classes applies to theirs and vice versa.
So to answer your question... no its not true that static imports work only with sun;s classes