![]() Difference between StringBuffer and StringBuilder?ĭifferences Between StringBuffer and StringBuilder? The class which is declared inside interface is always public and static whether we are declaring or not.ĥ. The interface which is declared inside interface is always public and static whether we are declaring or not. The interface which is declared inside a class is always static where we are declaring or not. The only applicable modifier for local variable is final.Ī. The only modifiers which are applicable for contractors are. The modifiers which are applicable only for methods and which we can‟t use anyware else native.ĥ. The modifiers which are applicable for classes but not for enums are final and abstract.Ĥ. The modifiers which are applicable for classes but not for interface are final.ģ. The modifiers which are applicable for inner classes but not for outer classes. What are the various modifiers available in java?ġ. ![]() equals() method is overridden for content comparison.Ĥ. In String class, all wrapper class and all collection classes. equals() method present in object class also meant for reference comparison only based on our requirement we can override for content comparison. In general we use = operator for reference comparison whereas. Difference between “= operator” and “equals() method” in java?ĭifference between = operater and. this changeble is nothing but mutability of the StringBuffer object.ģ. Once we creates a StringBuffer object we can perform any type of changes in the existing object. this non changeable nature is nothing but immutability of the string object.Ģ. if we are trying to perform any changes with those changes a new object will be created. Once we creates a string object we can‟t perform any changes in the existing object. ![]() Differences between String and StringBuffer?ġ. where as finalize() meant for cleanup activities related to object.Ģ. Try įinalize() is a method which is always invoked by garbage collector just before destroying an object to perform cleanup activities.įinally meant for cleanup activities related to try block. finally is a block always associated with try catch to maintain cleanup code. If a varaiable declared as final then it will become constant and we can’t perform re-assignment for that variable.ġ. If a method declared as final then we can’t override that method in the child class. ![]() i.e we can’t create child class for that class.Ģ. If a class declared as final then we can’t extend that class. Final is a modifier applicable for classes methods and variables. Difference between final, finally, finalize?ġ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |