|
41 | 41 | * [Java Abstraction](#-17-java-abstraction)
|
42 | 42 | * [Java Interfaces](#-18-java-interfaces)
|
43 | 43 | * [Java Encapsulation](#-19-java-encapsulation)
|
44 |
| -* [Miscellaneous](#-20-react-miscellaneous) |
| 44 | +* [Miscellaneous](#-20-miscellaneous) |
45 | 45 |
|
46 | 46 | <br/>
|
47 | 47 |
|
|
85 | 85 | <b><a href="#related-topics">↥ back to top</a></b>
|
86 | 86 | </div>
|
87 | 87 |
|
| 88 | +## Q. What is Nashorn? |
| 89 | + |
| 90 | +**Nashorn** is a JavaScript engine developed in Java by Oracle. Designed to provide the ability to embed JavaScript code in Java applications. Compared to Rhino , which is supported by the Mozilla Foundation, Nashorn provides 2 to 10 times better performance, as it compiles code and transfers bytecode to the Java virtual machine directly in memory. Nashorn can compile JavaScript code and generate Java classes that are loaded with a special loader. It is also possible to call Java code directly from JavaScript. |
| 91 | + |
| 92 | +<div align="right"> |
| 93 | + <b><a href="#related-topics">↥ back to top</a></b> |
| 94 | +</div> |
| 95 | + |
| 96 | +## Q. What is jjs? |
| 97 | + |
| 98 | +`jjs` - This is a command line utility that allows you to execute JavaScript programs directly in the console. |
| 99 | + |
| 100 | +<div align="right"> |
| 101 | + <b><a href="#related-topics">↥ back to top</a></b> |
| 102 | +</div> |
| 103 | + |
88 | 104 | ## Q. In Java, How many ways you can take input from the console?
|
89 | 105 |
|
90 | 106 | In Java, there are three different ways for reading input from the user in the command line environment ( console ).
|
@@ -893,14 +909,16 @@ The default methods of the implemented functional interface are not allowed to b
|
893 | 909 |
|
894 | 910 | If the method existing in the class already does everything that is necessary, then you can use the method reference mechanism (method reference) to directly pass this method. The result will be exactly the same as in the case of defining a lambda expression that calls this method.
|
895 | 911 |
|
| 912 | +**Example:** |
| 913 | + |
896 | 914 | ```java
|
897 |
| -private interface Measurable { |
898 |
| - public int length ( String string ); |
| 915 | +private interface Measurable { |
| 916 | + public int length(String string); |
899 | 917 | }
|
900 | 918 |
|
901 | 919 | public static void main ( String [] args) {
|
902 |
| - Measurable a = String::length; |
903 |
| - System.out.println(a.length("abc")); |
| 920 | + Measurable a = String::length; |
| 921 | + System.out.println(a.length("abc")); |
904 | 922 | }
|
905 | 923 | ```
|
906 | 924 |
|
@@ -4530,22 +4548,6 @@ To define a repeatable annotation, you must create a container annotation for th
|
4530 | 4548 | <b><a href="#related-topics">↥ back to top</a></b>
|
4531 | 4549 | </div>
|
4532 | 4550 |
|
4533 |
| -## Q. What is Nashorn? |
4534 |
| -
|
4535 |
| -**Nashorn** is a JavaScript engine developed in Java by Oracle. Designed to provide the ability to embed JavaScript code in Java applications. Compared to Rhino , which is supported by the Mozilla Foundation, Nashorn provides 2 to 10 times better performance, as it compiles code and transfers bytecode to the Java virtual machine directly in memory. Nashorn can compile JavaScript code and generate Java classes that are loaded with a special loader. It is also possible to call Java code directly from JavaScript. |
4536 |
| -
|
4537 |
| -<div align="right"> |
4538 |
| - <b><a href="#related-topics">↥ back to top</a></b> |
4539 |
| -</div> |
4540 |
| -
|
4541 |
| -## Q. What is jjs? |
4542 |
| -
|
4543 |
| -`jjs` - This is a command line utility that allows you to execute JavaScript programs directly in the console. |
4544 |
| -
|
4545 |
| -<div align="right"> |
4546 |
| - <b><a href="#related-topics">↥ back to top</a></b> |
4547 |
| -</div> |
4548 |
| -
|
4549 | 4551 | ## Q. What class appeared in Java 8 for encoding / decoding data?
|
4550 | 4552 |
|
4551 | 4553 | `Base64`- a thread-safe class that implements a data encoder and decoder using a base64 encoding scheme according to RFC 4648 and RFC 2045 .
|
|
0 commit comments