Submitted by heartin on Fri, 08/24/2012 - 23:52
You are allowed to put a label on any statement. Labels are given points in code mainly used along with goto in some other languages. Labels are rarely needed in Java, which lacks a goto statement like some other languages.
In java, labels are mainly used by break and continue statements which normally terminate or continue the innermost block.
Submitted by heartin on Fri, 08/24/2012 - 23:43
There are three types of comments used in Java. These are single line comments, block comments and documentation comment. Also read why block comments might not always reliably comment out a section of code.
Submitted by heartin on Wed, 08/22/2012 - 09:23
Charset is a combination of a coded character set and a character-encoding scheme. Here ‘set’ refers to the set of characters and their numbers (code points), and ‘encoding’ refers to the representation of these code points. We will also discuss common encoding related errors.
Submitted by heartin on Wed, 08/22/2012 - 09:21
All Unicode characters can be used in comments, character and string literals in java. Unicode characters can be expressed through Unicode Escape Sequences.
Unicode escape sequences consist of
Submitted by heartin on Wed, 08/22/2012 - 09:18
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems. The objective of Unicode is to unify all the different encoding schemes so that the confusion between computers can be limited as much as possible. Currently the Unicode standard defines values for over 100,000 characters.
Submitted by heartin on Wed, 08/22/2012 - 09:04
Escape characters (also called escape sequences or escape codes) in general are used to signal an alternative interpretation of a series of characters. In Java, a character preceded by a backslash (\) is an escape sequence and has special meaning to the java compiler.
Submitted by heartin on Wed, 08/22/2012 - 03:59
Strings are immutable and a new String object is created every time you modify a Sring object. A StringBuffer is a thread-safe, mutable sequence of characters. A StringBuilder is similar to StringBuffer, but with no guarantee of synchronization.
Submitted by heartin on Tue, 08/21/2012 - 09:50
We will discuss String Replace and String Split in Java with some examples. String replace is the process by which we replace parts of a string with another string. Some Java methods directly accept character sequences, while some others accept a regular expression (regex). We will discuss some of these approaces using examples. String split is the process by which a string is split around a delimiter.
Submitted by heartin on Tue, 08/21/2012 - 09:12
Data with other data types can be converted to String using explicit and automatic ways in Java. Explicit String conversion ways include:
- Use of the toString() method of an object, especially wrapper classes.
- Use of the static overloaded method String.valueOf, passing in the other data type value.
- Use of a String constructor to convert a byte array as a String.
Submitted by heartin on Tue, 08/21/2012 - 08:20
String interning is a method of storing only one copy of each distinct string value, which must be immutable. The distinct values are stored in a string intern pool. The single copy of each string is called its 'intern' and is typically looked up by a method (e.g. String.intern() in Java.).