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
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class RegTst { | |
| static Pattern cppccomment = Pattern.compile("(//(.*)$)|(/\\*(.*)\\*/)", | |
| Pattern.MULTILINE); | |
| public static void main(String[] args) { | |
| try | |
| { | |
| Matcher m = cppccomment |
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
| a:link { } | |
| a:visited { } | |
| a:hover { } | |
| a:active { } |
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
| // Смешанная инициализация массивов Mixed arrays initializating | |
| char[] ghj = new char[]{'a','n'}; |
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
| // Использование StringBuilder (StringBuilder - потоко-небезопасен) | |
| StringBuilder hi = new StringBuilder(); | |
| hi.append("Привет, мир"); | |
| hi.append("!"); | |
| System.out.println(hi.toString()); |
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
| Map<String, String> map = new HashMap<>(); | |
| map.put("1", "2"); | |
| map.put("3", "4"); | |
| Map<String, String> mapCopy = new HashMap<>(map); | |
| for(Map.Entry<String, String> pair : mapCopy.entrySet()) { | |
| map.remove(pair.getKey()); | |
| } |
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
| // Сравнение чисел float: проверка абсолютного значения разности | |
| float f1 = 0.3f; | |
| float f2 = 0.4f; | |
| float f3 = f1 + f2; | |
| float f4 = 0.7f; | |
| System.out.println("|f3-f4|<1e-6: " + ( Math.abs(f3-f4) < 1e-6 )); |
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
| // Сравнение строк в Java | |
| String str = "string"; | |
| if ("string".equals(str)) { | |
| System.out.println("true"); | |
| } |
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
| <table> | |
| <tr> | |
| <td>...</td> | |
| </tr> | |
| </table> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| <link rel="stylesheet" type="text/css" href="style2.css" /> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | |
| </head> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | |
| </head> | |
| <body> |