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 org.w3c.dom.Document; | |
| import org.w3c.dom.Element; | |
| import org.w3c.dom.NodeList; | |
| import org.xml.sax.SAXException; | |
| import javax.xml.parsers.DocumentBuilder; | |
| import javax.xml.parsers.DocumentBuilderFactory; | |
| import javax.xml.parsers.ParserConfigurationException; | |
| import javax.xml.transform.Transformer; | |
| import javax.xml.transform.TransformerException; |
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
| class ImageDownloadTask implements Runnable { | |
| private URL imageURL; | |
| public void run() { | |
| for(int i = 0; i < 3; i++) { | |
| if(isImageDownloaded()) break; // return | |
| } | |
| } | |
| private boolean isImageDownloaded() { |
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
| class App { | |
| public statioc void main() { | |
| } | |
| } |
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 com.company; | |
| public class Main { | |
| public static void main(String args[]){ | |
| int i, j, a=0; | |
| for(i = 1; i < 10; i++){ | |
| for(j = 1; j < 10; j++) { | |
| a = i*j; |
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 com.company; | |
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner scan = new Scanner(System.in); | |
| int n = scan.nextInt(); | |
| int sum = 0; | |
| for(int i=0;i<=n;i++){ |
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 com.company; | |
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner scan = new Scanner(System.in); | |
| System.out.println("Введіть розмірність масиву m*n:"); | |
| int m = scan.nextInt(); | |
| int n = scan.nextInt(); | |
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 com.company; | |
| public class Main { | |
| public static void main(String args[]) { | |
| for (int i = 1; i < 10; i++) { | |
| for (int j = 1; j < 10; j++) { | |
| if (i < j) { | |
| System.out.print(" # "); | |
| } else { | |
| System.out.print(i*j + " "); |
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 com.google.gson.Gson; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Gson gson = new Gson(); | |
| Human human = new Human(); | |
| human.setAge(21); | |
| human.setName("Sasha"); | |
| String humanJson = gson.toJson(human); | |
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.io.InputStream; | |
| import java.net.URL; | |
| import java.net.URLConnection; | |
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) throws Exception { | |
| URL url = new URL("http://example.com"); | |
| URLConnection urlConnection = url.openConnection(); | |
| InputStream inputStream = urlConnection.getInputStream(); |
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
| var fibonacci = (function () { | |
| var cache = []; | |
| return function fibo(n) { | |
| if (cache[n]) return cache[n]; | |
| return cache[n] = n == 0 ? 0 : | |
| n == 1 ? 1 : | |
| fibo(n-1) + fibo(n-2); | |
| }; |