java

java polymorphism

Using a child class as a parent class An important aspect of polymorphism is the ability to use an object of a child cla ... the times I ask this question, and preferably an example, and a good article and a task on the topic of polymorphism. Thanks.

mvn compile -> Error No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I want to run the project via the command line mvn compile But I get an error: [ERROR] COMPILATION ERROR : [INFO] ------ ... atform encoding: Cp1251 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" How to solve the problem?

How does memory allocation work in Java?

I'm just starting to learn java, and I don't understand some things. I read that most of the variables are stored in the heap ... ects? So if I create a regular integer variable, it is stored in the heap and I access it by reference? Thank you in advance.

Android Q, scoped storage

As you know, in Android Q (API=29), Google once again changed the rules for accessing external memory (external storage) and ... rd design: SQLiteDatabase db=SQLiteDatabase.openDatabase(file.getPath(), null, SQLiteDatabase.OPEN_READWRITE);

How do I specify the length of an empty two-dimensional array?

There is a task to write a method that returns the maximum value in a two-dimensional array. The meaning of doing it is clear ... want to use if-else branching, but I can't figure out how to specify the length of an empty array in the if (/) property){}?

What is this syntax inside html [[${...}]]?

Sorry for the strange wording of the question, I just don't know how to describe it. I have a Java Spring project using Sprin ... displays not an empty line, but some specific one, for example, "Sign in". That is, I need something like if-else in html.

Moxy example with Fragments

Maybe someone figured out how Moxy works with Fragment ? Please help me! I've been having fun for a week now. I can't impleme ... ation 'com.github.moxy-community:moxy-androidx:1.0.13' implementation 'com.github.moxy-community:moxy-material:1.0.13' }

The app crashes when replacing a fragment

When I click on the replace fragment button, the app crashes. MainActivity.java: public class MainActivity extends AppCompa ... at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at

Android Client-server application

You need to create a client-server application that displays a list of files by category. For example, the server contains fo ... ity to download the desired file. Where to start digging and are there any tutorials where such functionality is implemented?

Create an array from arrays: is it real?

It was necessary to return two arrays, there was an idea to make an array of arrays: String[] names ={"dsgsdfh", "sd vsd"}; S ... to create an array from arrays? P.s. I'm not asking how to return two arrays, I'm asking about creating an array from arrays

Intellij Idea - how to translate an entire java project to UTF-8

I have an old project that is not encoded in UTF-8, I need to translate the entire project to UTF-8. I work in Intellij Idea. ... ed at the beginning of each file. Maybe there is a plugin that will carefully translate all classes into UTF-8 encoding ?

How to fix a doubleclick in a fragment

There are 3 fragments and a bottomNavBar. When switching from fragment to fragment, the docx file must be processed. everythi ... ferences.edit(); ed.putString(SAVED_TEXTDocx, textViewMain.getText().toString()); ed.commit(); } }

Deleting characters in a string

Hello! There is a string, for example, String out = "qwerty"; I want to remove from it from 1 to 3 characters. Is it possible ... something similar for String? If not, how do I properly copy a string from String to StringBuilder or StringBuffer and back?

Pascal's triangle without arrays

How do I write an algorithm that outputs a Pascal triangle to the console without using arrays? p.s. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 и т.д. p.p.s мне никаких идей не приходит :(

toString method()

I have a question about using the toString () method, overriding it As far as I know, it is used for convenient output of dat ... t the task says that the method that prints the information must be in the same class as all its data. Thank you in advance!

Using numbers when overriding the hashCode method

Yes, you can find an article in Google We are dealing with hashCode () and equals () , where the rules for redefining hashCo ... umber? Why does the hash need to be multiplied by itself every time (adding the hashes of the object fields is clear to me)?

How to make random numbers not repeated

For example, there is a code that works when you click int random = (int)(Math.random() * 5); How to make sure that when you ... й клик: получилось 4 третьий клик: получилось опять 4 How to make sure that the numbers are not repeated 2 times in this way

Guide in Russian about Actionscript 3

Advise a couple of good guides/books about Actionscript 3. I know Java at the Junior level , the syntax of Actionscript 3 is ... times I have to peek into the dictionary. For now, I want to read the information in Russian, and only then switch to English

Error in comparing values when using BigDecimal and compareTo () in Java

Dear developers! The task is to compare the data and make calculations. Unfortunately, after writing the tests, it turned out ... l.valueOf(2.2), actual); } Also below I attach screenshots of the method and class + how the tests themselves worked :

Reading from files character-by-character into a JAVA array

You need to read from the file character-by-character into the array and in the future so that you can process the elements of the array( search for So_to_The element and its removal from the array, but this is not the main thing)