Posts

To enter these codes just pull up the default dialer app and use your chubby fingers to press the correct buttons. Code Description *#*#4636#*#* Display information about Phone, Battery and Usage statistics *#*#7780#*#* Restting your phone to factory state-Only deletes application data and applications *2767*3855# It’s a complete wiping of your mobile also it reinstalls the phones firmware *#*#34971539#*#* Shows completes information about the camera *#*#7594#*#* Changing the power button behavior-Enables direct poweroff once the code enabled *#*#273283*255*663282*#*#* For a quick backup to all your media files *#*#197328640#*#* Enabling test mode for service activity *#*#232339#*#* OR *#*#526#*#* Wireless Lan Tests *#*#232338#*#* Displays Wi-Fi Mac-address *#*#1472365#*#* For a quick GPS test *#*#1575#*#* A Different type GPS test *#*#0283#*#* Packet Loopback test *#*#0*#*#* LCD display test *#*#0673#*#* OR *#*#0289#*#* ...

Hierarchy Of HashMap In Java

Image

The substring() Method in JDK 6 and JDK 7

Image
The substring() Method in JDK 6 and JDK 7 The substring(int beginIndex, int endIndex) method in JDK 6 and JDK 7 are different. Knowing the difference can help you better use them. For simplicity reasons, in the following substring() represent the substring(int beginIndex, int endIndex) method. 1. What substring() does? The substring(int beginIndex, int endIndex) method returns a string that starts with beginIndex and ends with endIndex-1. String x = "abcdef" ; x = x. substring ( 1 , 3 ) ; System . out . println ( x ) ; Output: bc 2. What happens when substring() is called? You may know that because x is immutable, when x is assigned with the result of x.substring(1,3), it points to a totally new string like the following: However, this diagram is not exactly right or it represents what really happens in the heap. What really happens when substring() is called is different between JDK 6 and JDK 7. 3. substring() in JDK 6 String is...

What is string immutability?

Image
What is string immutability? Here are a set of diagrams to illustrate Java String's  immutability . 1. Declare a string String s = "abcd" ; s stores the reference of the string object. The arrow below should be interpreted as "store reference of". 2. Assign one string variable to another string variable String s2 = s ; s2 stores the same reference value, since it is the same string object. 3. Concat string s = s. concat ( "ef" ) ; s now stores the reference of newly created string object. Summary Once a string is created in  memory (heap), it can not be changed. We should note that all methods of String do not change the string itself, but rather return a new String. If we need a string that can be modified, we will need StringBuffer or StringBuilder. Otherwise, there would be a lot of time wasted for Garbage Collection, since each time a new String is created.  Here  is an example of StringBuilder u...
Image
Image
Image
Object Oriented Programming (OOP) Java is a computer programming language that is concurrent, class-based and object-oriented. The advantages of object oriented software development are shown below: Modular development of code, which leads to easy maintenance and modification. Reusability of code. Improved reliability and flexibility of code. Increased understanding of code. Object-oriented programming contains many significant features, such as encapsulation, inheritance, polymorphism and abstraction. We analyze each feature separately in the following sections. Encapsulation Encapsulation provides objects with the ability to hide their internal characteristics and behavior. Each object provides a number of methods, which can be accessed by other objects and change its internal data. In Java, there are three access modifiers: public, private and protected. Each modifier imposes different access rights to other classes, either in the same or in external p...