![]() You need to use Comparable or Comparator interface to sort list of custom objects. You have a list of Custom objects? How can you sort them? It is more performance efficient as it is not thread-safe.ĬlassPath is environment variable which java virtual machine (JVM) uses to locate all classes which is used by the program.įor example: jre/lib/rt.jar has all java classes and you also need to include jar files or class file which is being used by program. What is the difference between StringBuffer and StringBuilder? No, You can not declare constructor final. ![]() Yes, we can have static method in the interface from Java 8. Can we have static method in the interface? Do you know how to make a class immutable? Can you provide steps for it? You can fin the detailed answer over here. Do you know why String is immutable in java? If you don’t want to make variable serializable, you can make it transient variable. Transient variables are used Serialization. Have you heard about transient variable? When will you use it? Yes, you can have abstract class without having any abstract method. Can we have abstract class without having any abstract method in it? What is the difference between HashMap and HashSet in java? You need to override hashcode and equals method in custom class while putting objects of custom class in HashMap. Which two methods should you override while putting the custom object as Key in HashMap?
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |