Core Java - Interview Questions and Answers for 'Static import' - 3 question(s) found - Order By Newest Q1. What are concepts introduced with Java 5 ? Core Java
Ans. Generics , Enums , Autoboxing , Annotations and Static Import. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   generics   enum   autoboxing   annotations   static import   rare Try 1 Question(s) TestRelated Questions Which annotations are used in Hibernate ? What is the use of @GeneratedValue annotation in Hibernate? Give an Example of Annotations ? What are few of the Annotations pre defined by Java? What are meta Annotations ? Name few meta-annotations ? How to create a Junit to make sure that the tested method throws an exception ? Explain Annotations ? What entries we make in the hibernate config file if we are not using hbm files but Annotations ? Ans. By static import , we can access the static members of a class directly without prefixing it with the class name. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java5   static import   static   java keyword   static import Asked in 4 Companies basic   frequent Related Questions Which of the following combination of keywords is illegal in Java ?
a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final How does volatile affect code optimization by compiler? What is Volatile keyword used for ? What is the use of Transient Keyword ? Can we access instance variables within static methods ? What is a Final Method ? What is a Final Class ? Can we override static methods ? Why ? What is "super" used for ? What is "this" keyword used for ? Q3. Which of the following syntax is correct ?import static java.lang.System.*;or static import java.lang.System.*; Core Java
Ans. import static java.lang.System.*; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   static import   generics   import   OCJP   SCJP   Oracle certified java developer Asked in 1 Companies Related Questions Which of the following are valid declarations
1. void method(int... x){};
2. void method(int.. x){};
3. void method(int.. .x){};
4. void method(int ...x){};
5. void method(int... x){};
6. void method(int ... x){};
7. void method(int x, int... y){};
8. void method(int... x, int y){};
9. void method(int... x,int... y){};
Can we overload method as following ?
void method(int... x){};
void method(int[] x){}; What will the following code print ? Why following method declarations are not valid ?
void method(int... x, int y){};
void method(int... x,int... y){}; Which method will get called if we call it as method(1)
void method(int x ){};
void method(int... x){};