java

Help us understand the type being passed to the parameterized FunctionalInterface

I solve, it seems, not a difficult problem:Create a NumberGenerator function interface that is parameterized so that it accep ... er types of the problem, how to make "universal"? In the getGenerator() method, what type should be passed to NumberGenerator

Java Math. random repeats the values. Galton Board

This program demonstrates the work of the Galton board. This board has a N slot on the bottom and one hole on the top. The to ... hile (times > 0) { //code... rand.setSeed(System.currentTimeMillis()); } // code... It didn't help

How super() works in Java

For example there is a code: Abstract class: public abstract class Direct { public Direct(char direct) { switch (direct ... s (the parent class), but why is the goToForward() class executed in Direct and not in DirectSouth ? Thanks for the answer :)

Using wildcard in Generics Java

Hello. So I decided to study Generic a little deeper, since there was a need to write my own class. I didn't pay attention b ... d items to a collection, for example. But I still didn't understand the point. Please explain in as much detail as possible.

Adapter pattern in Java and exceptions

Hello. I'm trying to implement a common interface for two classes that return the same type of data, but do it in their own w ... established. In another class (LocalDataAdapter) method does not throw exceptions. How to unify the interface for this case?

I can't implement List collection methods in JAVA

Encountered a problem when executing the task: I can't implement the methods of the List collection in accordance with the ta ... sk = Integer.parseInt(task); } else if (input.equals("end")) { for (String task : list) { } } }

Create a PostgreSQL database using an SQL script for a java application

I am making an application on Java with a small local database and I need this database to be created using an sql file. That ... maintainer SUPERUSER CREATEROLE CREATEDB; Tell me, will it work and create a database and if so, how do I run this script?

Queuing processes - java

I need to do it in java, so that I can put processes in a queue and they are executed in turn. Tipo: One process monitors th ... } catch (IOException e) { e.printStackTrace(); } } })); }

Output of a two-dimensional array

I need to output a two-dimensional array, but I get the wrong character format if ("next4".equals(e.getActionCommand())) { ... 0; i < 19; i++) { for (int j = 0; j < 19; j++) { tableNum[i][j] = (int) i * j; } } }

Checking the device for root

I need to check if the device has root before installing my app and if so, disable the app installation. Is there any way to implement this?

Why do I need static non-nested classes?

Why do I need static non-nested classes?

The difference and correctness of using abstract classes from interfaces in Java

I'm trying to understand how these two elements differ. I read here and here, as well as the lecture I am studying. If I unde ... d move (int n, int m)? PS PS PS: Sorry for the large number of questions. I just would like to fully understand this topic)

What should I do if the android emulator is lagging?

Hello everyone. I have a problem with the android device emulator, it takes a very long time to start and also lags terribly. ... x3 3.4 GHz and 8GB of memory. It is absolutely impossible to work with this. What to do? I didn't find a solution in Google.

How are Java and Kotlin going for mobile app and game development?

I've read a bunch of topics on this subject, but there are other questions from me already. What are the advantages of kno ... rm in general can you create games on J. + K.? Is it possible to create 3D games in these languages separately or together?

How do I make an api request to stepik in java?

You need to get information about a specific course on stepik using the java api. I need to make a request so as to get a lis ... d it, you can take all the courses and filter out those where enrollment: null , but can someone look and help with the code?

Spring. Rest API. Java

Working with the phone book. I write the server part, I want to change the created user's data(name and number), add, delete, ... And yes, am I doing everything right? There are just suspicions that with such a code I will be sent to a walking romantic...

Creating the Spring boot Rest api

Help me not clear errors, I started digging in Spring Boot, and tried to create a Rest site, I tried three guides and I alway ... tion for DDL execution Caused by: java.sql.SQLSyntaxErrorException: Unknown database 'messages&servertimezone=utc&'

How to find out how much free RAM is available

On a cloud wheelbarrow, there is a feeling that there is not enough RAM (but there is no access to the wheelbarrow, nor is it ... swer comes out 1486355940 megabytes, on the local machine (I decided to push it), but on the locale I have only 16 operatives

How return Java works

Learning Java in my head does not fit-how does return work and in what cases it is used. I reread a lot of different informat ... of the action, System.out.println is called with the result. How does it work? Thank you in advance for explaining this point

Why don't I see what I want when I output the array in the console?

I study java from time to time and came across this: public static void testArray(){ int myArray[] = {1, 2, 3, 4, 5}; ... h a large number of operations). In general, how do I output the values of an array, and what would it be in normal the view?