What are the restriction imposed on a static method or a static block of code?
What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }
How do you compare two strings lexicographically?
Explain about static imports in java?
What are the ways to instantiate the class class?
What is the maximum size of hashmap in java?
what is the difference between Cpp And Java
what is private constructor?what are the uses of writing private constructor in our program?
Why would you desing a J2EE application so user data is entered by way of a JSP page and managed by an underlying Java Beans class?
what is a transient variable?
What is the difference between @before and @beforeclass annotation?
How do you sort arrays in java?
What is the return type of the main method?