This file contains hidden or 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 br.com.ocjp.generics; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; | |
| public class AppSorted { | |
| public static void main(String[] args) { | |
This file contains hidden or 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 br.com.ocjp.generics; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class AppArrayList { | |
| public static void main(String[] args) { | |
| List<String> list = new ArrayList<String>(); | |
| String s = "new"; |
This file contains hidden or 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 br.com.ocjp.generics; | |
| import java.util.ArrayList; | |
| import java.util.Hashtable; | |
| import java.util.LinkedHashSet; | |
| import java.util.Map; | |
| public class AppOrdered { | |
| public static void main(String[] args) { |
This file contains hidden or 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 br.com.ocjp.generics; | |
| public class Employee { | |
| private String name; | |
| private int age; | |
| public String getName() { | |
| return name; | |
| } |
This file contains hidden or 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 br.com.ocjp.generics; | |
| public class AppEquals { | |
| public static void main(String[] args) { | |
| Employee e = new Employee(); | |
| e.setName("David"); | |
| e.setAge(34); | |
| Employee e1 = new Employee(); |
This file contains hidden or 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 br.com.ocjp.generics; | |
| public class AppEquals { | |
| public static void main(String[] args) { | |
| Employee e = new Employee(); | |
| e.setName("David"); | |
| e.setAge(34); | |
| Employee e1 = new Employee(); |
This file contains hidden or 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 br.com.ocjp.generics; | |
| public class Employee { | |
| private String name; | |
| private int age; | |
| public String getName() { | |
| return name; | |
| } |
This file contains hidden or 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 br.com.ocjp.regex; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class RegexFirst { | |
| public static void main(String[] args) { | |
| Pattern p = Pattern.compile("aba"); | |
| Matcher m = p.matcher("abababa"); // index starts from 0 |
This file contains hidden or 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 br.com.ocjp.regex; | |
| public class AppPrintf { | |
| public static void main(String[] args) { | |
| boolean b = true; | |
| double num = 565.99; | |
| long num1 = 6565415; | |
| System.out.printf("%1$010d \n",num1); |
This file contains hidden or 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 br.com.ocjp.regex; | |
| import java.util.Scanner; | |
| public class AppScanner { | |
| public static void main(String [] args) { | |
| boolean b2, b; | |
| int i; | |
| String s, hits = " "; |
NewerOlder