Skip to content

Commit b0f5771

Browse files
committed
Update README.md
1 parent e6d2bb5 commit b0f5771

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3708,15 +3708,15 @@ class Visitor{
37083708
* Added utility `jdeps` for analyzing .class files.
37093709

37103710
<div align="right">
3711-
<b><a href="#">↥ back to top</a></b>
3711+
<b><a href="#related-topics">↥ back to top</a></b>
37123712
</div>
37133713

37143714
## Q. Can you declare an interface method static?
37153715

37163716
Java 8 interface changes include static methods and default methods in interfaces. Prior to Java 8, we could have only method declarations in the interfaces. But from Java 8, we can have default methods and static methods in the interfaces.
37173717

37183718
<div align="right">
3719-
<b><a href="#">↥ back to top</a></b>
3719+
<b><a href="#related-topics">↥ back to top</a></b>
37203720
</div>
37213721

37223722
## Q. What is a lambda?
@@ -3804,7 +3804,7 @@ public static void main ( String [] args) {
38043804
```
38053805

38063806
<div align="right">
3807-
<b><a href="#">↥ back to top</a></b>
3807+
<b><a href="#related-topics">↥ back to top</a></b>
38083808
</div>
38093809

38103810
## Q. What variables do lambda expressions have access to?
@@ -3818,7 +3818,7 @@ Access to external scope variables from a lambda expression is very similar to a
38183818
The default methods of the implemented functional interface are not allowed to be accessed inside the lambda expression.
38193819

38203820
<div align="right">
3821-
<b><a href="#">↥ back to top</a></b>
3821+
<b><a href="#related-topics">↥ back to top</a></b>
38223822
</div>
38233823

38243824
## Q. How to sort a list of strings using a lambda expression?
@@ -3831,7 +3831,7 @@ public static List < String > sort ( List < String > list) {
38313831
```
38323832

38333833
<div align="right">
3834-
<b><a href="#">↥ back to top</a></b>
3834+
<b><a href="#related-topics">↥ back to top</a></b>
38353835
</div>
38363836

38373837
## Q. What is a method reference?
@@ -3852,7 +3852,7 @@ public static void main ( String [] args) {
38523852
Method references are potentially more efficient than using lambda expressions. In addition, they provide the compiler with better information about the type, and if you can choose between using a reference to an existing method and using a lambda expression, you should always use a method reference.
38533853

38543854
<div align="right">
3855-
<b><a href="#">↥ back to top</a></b>
3855+
<b><a href="#related-topics">↥ back to top</a></b>
38563856
</div>
38573857

38583858
## Q. What types of method references do you know?
@@ -3862,15 +3862,15 @@ Method references are potentially more efficient than using lambda expressions.
38623862
* to the constructor.
38633863

38643864
<div align="right">
3865-
<b><a href="#">↥ back to top</a></b>
3865+
<b><a href="#related-topics">↥ back to top</a></b>
38663866
</div>
38673867

38683868
## Q. Explain the expression `System.out::println`?
38693869

38703870
The specified expression illustrates passing a reference to a static method of a `println()`class `System.out`.
38713871

38723872
<div align="right">
3873-
<b><a href="#">↥ back to top</a></b>
3873+
<b><a href="#related-topics">↥ back to top</a></b>
38743874
</div>
38753875

38763876
## Q. What is a Functional Interface?
@@ -3882,7 +3882,7 @@ To accurately determine the interface as functional, an annotation has been adde
38823882
An interface can include as many `default` methods as you like while remaining functional, because `default` methods are not abstract.
38833883

38843884
<div align="right">
3885-
<b><a href="#">↥ back to top</a></b>
3885+
<b><a href="#related-topics">↥ back to top</a></b>
38863886
</div>
38873887

38883888
## Q. What is StringJoiner?
@@ -3898,7 +3898,7 @@ System.out.println(joiner); // prefix-Hello.the.brave.world-suffix
38983898
```
38993899

39003900
<div align="right">
3901-
<b><a href="#">↥ back to top</a></b>
3901+
<b><a href="#related-topics">↥ back to top</a></b>
39023902
</div>
39033903

39043904
## Q. What are `default`interface methods?
@@ -3923,7 +3923,7 @@ interface Example {
39233923
* One of the main reasons for introducing default methods is the ability of collections in Java 8 to use lambda expressions.
39243924

39253925
<div align="right">
3926-
<b><a href="#">↥ back to top</a></b>
3926+
<b><a href="#related-topics">↥ back to top</a></b>
39273927
</div>
39283928

39293929
## Q. How to call `default` interface method in a class that implements this interface?
@@ -3945,7 +3945,7 @@ class License implements Paper {
39453945
```
39463946

39473947
<div align="right">
3948-
<b><a href="#">↥ back to top</a></b>
3948+
<b><a href="#related-topics">↥ back to top</a></b>
39493949
</div>
39503950

39513951
## Q. What is `static` interface method?
@@ -3957,7 +3957,7 @@ Static interface methods are similar to default methods, except that there is no
39573957
* Static methods in the interface are used to provide helper methods, for example, checking for null, sorting collections, etc.
39583958

39593959
<div align="right">
3960-
<b><a href="#">↥ back to top</a></b>
3960+
<b><a href="#related-topics">↥ back to top</a></b>
39613961
</div>
39623962

39633963
## Q. How to call `static` interface method?
@@ -3979,7 +3979,7 @@ class License {
39793979
```
39803980

39813981
<div align="right">
3982-
<b><a href="#">↥ back to top</a></b>
3982+
<b><a href="#related-topics">↥ back to top</a></b>
39833983
</div>
39843984

39853985
## Q. What is Optional
@@ -3996,7 +3996,7 @@ optional.orElse( " ops ... " ); // "hello"
39963996
```
39973997

39983998
<div align="right">
3999-
<b><a href="#">↥ back to top</a></b>
3999+
<b><a href="#related-topics">↥ back to top</a></b>
40004000
</div>
40014001

40024002
## Q. What is Stream?
@@ -4021,7 +4021,7 @@ In addition to the universal object, there are special types of streams to work
40214021
* support additional end operations `sum()`, `average()`, `mapToObj()`.
40224022

40234023
<div align="right">
4024-
<b><a href="#">↥ back to top</a></b>
4024+
<b><a href="#related-topics">↥ back to top</a></b>
40254025
</div>
40264026

40274027
## Q. What are the ways to create a stream?
@@ -4075,15 +4075,15 @@ Stream < String > fromGenerate = Stream.generate(() -> " 0 " );
40754075
```
40764076

40774077
<div align="right">
4078-
<b><a href="#">↥ back to top</a></b>
4078+
<b><a href="#related-topics">↥ back to top</a></b>
40794079
</div>
40804080

40814081
## Q. What is the difference between `Collection` and `Stream`?
40824082

40834083
Collections allow you to work with elements separately, while streams do not allow this, but instead provides the ability to perform functions on data as one.
40844084

40854085
<div align="right">
4086-
<b><a href="#">↥ back to top</a></b>
4086+
<b><a href="#related-topics">↥ back to top</a></b>
40874087
</div>
40884088

40894089
## Q. What is the method `collect()`for streams for?
@@ -4119,7 +4119,7 @@ Collector < String , a List < String > , a List < String > > toList = Collector
41194119
```
41204120

41214121
<div align="right">
4122-
<b><a href="#">↥ back to top</a></b>
4122+
<b><a href="#related-topics">↥ back to top</a></b>
41234123
</div>
41244124

41254125
## Q. Why do streams use `forEach()`and `forEachOrdered()` methods?
@@ -4128,7 +4128,7 @@ Collector < String , a List < String > , a List < String > > toList = Collector
41284128
* `forEachOrdered()` applies a function to each stream object while maintaining the order of the elements.
41294129

41304130
<div align="right">
4131-
<b><a href="#">↥ back to top</a></b>
4131+
<b><a href="#related-topics">↥ back to top</a></b>
41324132
</div>
41334133

41344134
## Q. What are `map()`, `mapToInt()`, `mapToDouble()` and `mapToLong()` methods in Stream?
@@ -4144,23 +4144,23 @@ Stream
41444144
```
41454145

41464146
<div align="right">
4147-
<b><a href="#">↥ back to top</a></b>
4147+
<b><a href="#related-topics">↥ back to top</a></b>
41484148
</div>
41494149

41504150
## Q. What is the purpose of `filter()` method in streams?
41514151

41524152
The method `filter()` is an intermediate operation receiving a predicate that filters all elements, returning only those that match the condition.
41534153

41544154
<div align="right">
4155-
<b><a href="#">↥ back to top</a></b>
4155+
<b><a href="#related-topics">↥ back to top</a></b>
41564156
</div>
41574157

41584158
## Q. What is the use of `limit()` method in streams?
41594159

41604160
The method `limit()`is an intermediate operation, which allows you to limit the selection to a certain number of first elements.
41614161

41624162
<div align="right">
4163-
<b><a href="#">↥ back to top</a></b>
4163+
<b><a href="#related-topics">↥ back to top</a></b>
41644164
</div>
41654165

41664166
## Q. What is the use of `sorted()` method in streams?
@@ -4170,7 +4170,7 @@ The method `sorted()`is an intermediate operation, which allows you to sort the
41704170
The order of the elements in the original collection remains untouched - `sorted()`it just creates its sorted representation.
41714171

41724172
<div align="right">
4173-
<b><a href="#">↥ back to top</a></b>
4173+
<b><a href="#related-topics">↥ back to top</a></b>
41744174
</div>
41754175

41764176
## Q. What streamers designed methods `flatMap()`, `flatMapToInt()`, `flatMapToDouble()`, `flatMapToLong()`?
@@ -4187,7 +4187,7 @@ Stream
41874187
`flatMapToInt()`, `flatMapToDouble()`, `flatMapToLong()`- are analogues `flatMap()`, returns the corresponding numerical stream.
41884188

41894189
<div align="right">
4190-
<b><a href="#">↥ back to top</a></b>
4190+
<b><a href="#related-topics">↥ back to top</a></b>
41914191
</div>
41924192

41934193
## Q. Tell us about parallel processing in Java 8?
@@ -4228,7 +4228,7 @@ collection.parallelStream ()
42284228
```
42294229

42304230
<div align="right">
4231-
<b><a href="#">↥ back to top</a></b>
4231+
<b><a href="#related-topics">↥ back to top</a></b>
42324232
</div>
42334233

42344234
## Q. What are the final methods of working with streams you know?
@@ -4250,7 +4250,7 @@ collection.parallelStream ()
42504250
* `average()` returns the arithmetic mean of all numbers.
42514251

42524252
<div align="right">
4253-
<b><a href="#">↥ back to top</a></b>
4253+
<b><a href="#related-topics">↥ back to top</a></b>
42544254
</div>
42554255

42564256
## Q. What intermediate methods of working with streams do you know?
@@ -4268,7 +4268,7 @@ collection.parallelStream ()
42684268
For numerical streams, an additional method is available `mapToObj()`that converts the numerical stream back to the object stream.
42694269

42704270
<div align="right">
4271-
<b><a href="#">↥ back to top</a></b>
4271+
<b><a href="#related-topics">↥ back to top</a></b>
42724272
</div>
42734273

42744274
## Q. What additional methods for working with associative arrays (maps) appeared in Java 8?
@@ -4316,23 +4316,23 @@ map.merge("a", "z", (value, newValue) -> value.concat(newValue)); //["a","Aaz"]
43164316
```
43174317

43184318
<div align="right">
4319-
<b><a href="#">↥ back to top</a></b>
4319+
<b><a href="#related-topics">↥ back to top</a></b>
43204320
</div>
43214321

43224322
## Q. What is LocalDateTime?
43234323

43244324
`LocalDateTime`combines together `LocaleDate`and `LocalTime`contains the date and time in the calendar system ISO-8601 without reference to the time zone. Time is stored accurate to the nanosecond. It contains many convenient methods such as plusMinutes, plusHours, isAfter, toSecondOfDay, etc.
43254325

43264326
<div align="right">
4327-
<b><a href="#">↥ back to top</a></b>
4327+
<b><a href="#related-topics">↥ back to top</a></b>
43284328
</div>
43294329

43304330
## Q. What is ZonedDateTime?
43314331

43324332
`java.time.ZonedDateTime`- an analogue `java.util.Calendar`, a class with the most complete amount of information about the temporary context in the calendar system ISO-8601. It includes a time zone, therefore, this class carries out all operations with time shifts taking into account it.
43334333

43344334
<div align="right">
4335-
<b><a href="#">↥ back to top</a></b>
4335+
<b><a href="#related-topics">↥ back to top</a></b>
43364336
</div>
43374337

43384338
## Q. How to determine repeatable annotation?
@@ -4351,23 +4351,23 @@ To define a repeatable annotation, you must create a container annotation for th
43514351
```
43524352

43534353
<div align="right">
4354-
<b><a href="#">↥ back to top</a></b>
4354+
<b><a href="#related-topics">↥ back to top</a></b>
43554355
</div>
43564356

43574357
## Q. What is Nashorn?
43584358

43594359
**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.
43604360

43614361
<div align="right">
4362-
<b><a href="#">↥ back to top</a></b>
4362+
<b><a href="#related-topics">↥ back to top</a></b>
43634363
</div>
43644364

43654365
## Q. What is jjs?
43664366

43674367
`jjs` - This is a command line utility that allows you to execute JavaScript programs directly in the console.
43684368

43694369
<div align="right">
4370-
<b><a href="#">↥ back to top</a></b>
4370+
<b><a href="#related-topics">↥ back to top</a></b>
43714371
</div>
43724372

43734373
## Q. What class appeared in Java 8 for encoding / decoding data?
@@ -4380,7 +4380,7 @@ Base64 contains 6 basic methods:
43804380
`getMimeEncoder() / getMimeDecoder()`- returns a MIME encoder / decoder conforming to RFC 2045 .
43814381

43824382
<div align="right">
4383-
<b><a href="#">↥ back to top</a></b>
4383+
<b><a href="#related-topics">↥ back to top</a></b>
43844384
</div>
43854385

43864386
## Q. How to create a Base64 encoder and decoder?
@@ -4393,7 +4393,7 @@ new String ( Base64.getDecoder().decode ( " aW5wdXQ == " ), " utf-8 " ); // inp
43934393
```
43944394

43954395
<div align="right">
4396-
<b><a href="#">↥ back to top</a></b>
4396+
<b><a href="#related-topics">↥ back to top</a></b>
43974397
</div>
43984398

43994399
## Q. What are the functional interfaces `Function<T,R>`, `DoubleFunction<R>`, `IntFunction<R>` and `LongFunction<R>`?
@@ -4413,7 +4413,7 @@ backToString.apply("123"); // "123"
44134413
* `LongFunction<R>`- a function that receives input `Long`and returns an instance of the class at the output `R`.
44144414

44154415
<div align="right">
4416-
<b><a href="#">↥ back to top</a></b>
4416+
<b><a href="#related-topics">↥ back to top</a></b>
44174417
</div>
44184418

44194419
## Q. What are the functional interfaces `UnaryOperator<T>`, `DoubleUnaryOperator`, `IntUnaryOperator`and `LongUnaryOperator`?
@@ -4430,7 +4430,7 @@ System.out.println(operator.apply ( 5 )); // 25
44304430
* `LongUnaryOperator`- unary operator receiving input `Long`.
44314431

44324432
<div align="right">
4433-
<b><a href="#">↥ back to top</a></b>
4433+
<b><a href="#related-topics">↥ back to top</a></b>
44344434
</div>
44354435

44364436
## Q. What are the functional interfaces `BinaryOperator<T>`, `DoubleBinaryOperator`, `IntBinaryOperator`and `LongBinaryOperator`?
@@ -4447,7 +4447,7 @@ System.out.println(operator.apply ( 1 , 2 )); // 3
44474447
* `LongBinaryOperator`- binary operator receiving input Long.
44484448

44494449
<div align="right">
4450-
<b><a href="#">↥ back to top</a></b>
4450+
<b><a href="#related-topics">↥ back to top</a></b>
44514451
</div>
44524452

44534453
## Q. What are the functional interfaces `Predicate<T>`, `DoublePredicate`, `IntPredicateand` `LongPredicate`?
@@ -4467,7 +4467,7 @@ predicate.negate().test("foo"); // false
44674467
* `LongPredicate`- predicate receiving input `Long`.
44684468

44694469
<div align="right">
4470-
<b><a href="#">↥ back to top</a></b>
4470+
<b><a href="#related-topics">↥ back to top</a></b>
44714471
</div>
44724472

44734473
## Q. What are the functional interfaces `Consumer<T>`, `DoubleConsumer`, `IntConsumer`and `LongConsumer`?
@@ -4484,7 +4484,7 @@ hello.accept( " world " );
44844484
* `LongConsumer`- the consumer receiving the input `Long`.
44854485

44864486
<div align="right">
4487-
<b><a href="#">↥ back to top</a></b>
4487+
<b><a href="#related-topics">↥ back to top</a></b>
44884488
</div>
44894489

44904490
## Q. What are the functional interfaces `Supplier<T>`, `BooleanSupplier`, `DoubleSupplier`, `IntSupplier`and `LongSupplier`?
@@ -4501,7 +4501,7 @@ now.get();
45014501
* `LongSupplier`- the supplier is returning `Long`.
45024502

45034503
<div align="right">
4504-
<b><a href="#">↥ back to top</a></b>
4504+
<b><a href="#related-topics">↥ back to top</a></b>
45054505
</div>
45064506

45074507
#### Q. When do we go for Java 8 Stream API?
@@ -4520,5 +4520,5 @@ now.get();
45204520
#### Q. What is the difference between @Before and @BeforeClass annotation?
45214521

45224522
<div align="right">
4523-
<b><a href="#">↥ back to top</a></b>
4523+
<b><a href="#related-topics">↥ back to top</a></b>
45244524
</div>

0 commit comments

Comments
 (0)