This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javaxp.ws.service; | |
import java.util.ArrayList; | |
import java.util.Hashtable; | |
import java.util.List; | |
import javax.ws.rs.Consumes; | |
import javax.ws.rs.DELETE; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.POST; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javaxp.ws.pojo; | |
import javax.xml.bind.annotation.XmlAttribute; | |
import javax.xml.bind.annotation.XmlRootElement; | |
import javax.xml.bind.annotation.XmlElement; | |
@XmlRootElement | |
public class Employee { | |
private String emplId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app version="2.5" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | |
<servlet> | |
<display-name>JAX-RS REST Servlet</display-name> | |
<servlet-name>JAX-RS REST Servlet</servlet-name> | |
<servlet-class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javaxp.ws.pojo; | |
public class Name { | |
private String firstName; | |
private String lastName; | |
public String getFirstName() { | |
return firstName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javaxp.ws.service; | |
import java.util.List; | |
import javax.ws.rs.Consumes; | |
import javax.ws.rs.DELETE; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.codec.binary.Base64; | |
import org.apache.commons.codec.binary.StringUtils; | |
public class Base64Example { | |
public static String decode(String str) { | |
return StringUtils.newStringUtf8(Base64.decodeBase64(str)); | |
} | |
public static String encode(String str) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class TryExample { | |
public static void main(String[] args) { | |
final String FILE = "C:/file/textFile.txt"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwitchExample | |
{ | |
public static void main(String[] args) { | |
final String MON = "Monday"; | |
final String TUE = "Tuesday"; | |
final String WED = "Wednesday"; | |
final String THU = "Thrusday"; | |
final String FRI = "Friday"; | |
final String SAT = "Saturday"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnderscoreLiteralsExample | |
{ | |
public static void main(String[] args) { | |
byte a = (byte) 0b10_10_10_10; | |
short b = (short) 45_54; | |
int c = 123_456_789; | |
long d = 111_222_333L; | |
float e = 11.22_77_99F; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BinaryLiteralsExample { | |
public static void main(String[] args) { | |
byte a = (byte) 0b10101000; | |
short b = (short) 0b1110000; | |
int c = (int) 0B1001001; | |
long d = 0b10110111011; | |
System.out.println("a = "+a); |
OlderNewer