web.xml
is the deployment descriptor for a Java web application.
We can specify the namespace declaration and schema location in web.xml
file for different Java servlet version:
- Java Servlet 3.1
- Java Servlet 3.0
- Java Servlet 2.5
- Java Servlet 2.4
public class StringBufferExample { | |
public static void main(String[] args) { | |
StringBuffer strBuf = new StringBuffer(); | |
// Append strings | |
strBuf.append("Welcome").append(' ').append("to").append(' ').append("Chankok.com"); | |
System.out.println("Append strings : " + strBuf.toString()); |
[ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Albania", | |
"code": "AL" | |
}, | |
{ |
public class StringBuilderExample { | |
public static void main(String[] args) { | |
StringBuilder sb = new StringBuilder(); | |
// Append strings | |
sb.append("Welcome").append(' ').append("to").append(' ').append("Chankok.com"); | |
System.out.println("Append strings : " + sb.toString()); |
// Syntax of catching multiple exceptions | |
Try { | |
// Execute statements that may throw exceptions | |
} catch (ExceptionType1 | ExceptionType2 | ... VariableName) { | |
// Handle exceptions |
package com.chankok.io; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class Java6ResourceManagementExample { | |
public static void main(String[] args) { | |
FileReader fr = null; |
package com.chankok.operators; | |
public class CheckEvenOddNumberExample { | |
public static void main(String[] args) { | |
// Initial the integer array | |
int[] intArrays = {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}; | |
/* |
package com.chankok.oop; | |
public class DataEncapsulationExample { | |
public static void main(String[] args) { | |
try { | |
Student student1 = new Student(); | |
student1.setName("Chankok"); |
package com.chankok.io; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class Java6ReadEntireFileExample { | |
public static void main(String[] args) { | |
FileReader fr = null; |
web.xml
is the deployment descriptor for a Java web application.
We can specify the namespace declaration and schema location in web.xml
file for different Java servlet version:
package com.chankok.arrays; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class StringArrayToStringExample { | |
public static void main(String[] args) { | |
// Initial the string array |