java

Creating a superclass object in Java

Please explain why the subclass and superclass constructor is called when creating a superclass object. public class Main { ... "is Person"); } } public class Student extends Person{ Student(){ System.out.println("is Student"); } }

Where is RelativeLayout located?

The author of the book, which I am currently studying, suggests that in Android Studio, drag the RelativeLayout component to ... Can you tell me how to replace RelativeLayout (or where to find it) so that I can complete the task described in the book?

Java Timer. Countdown after the start of the stream

I use Timer and set the timer via the shedule() method, setting a repeat every N seconds. But I ran into a problem, I need to ... impleName() + " and it was " + new SimpleDateFormat("HH:mm:ss").format(new Date())); bot.setTaskForTimer(); } }

JSON Parsing on Android

Good evening, everyone. There is a JSON file that needs to be parsed. Structure JSON below: { "Italiano" : [ ... algorithm for parsing this file. Please help me! Apparently I myself will not get out of this stopper! Thank you in advance!

Hosting for a Java application: help me figure it out

I wrote a simple Java server on sockets. I run it in Eclipse - everything is fine, works, interacts with the client. Now I wa ... this difficult topic, maybe you can recommend reading something? And then I look: Jboss, Tomcat... Is this even on my topic?

Sorting in Java

I read in the documentation and found no explanation anywhere (Googled without result), why for the implementation of sortin ... /tl/jdk/rev/bfd7abda8f79 They promise great performance (for additional memory max n / 2 !) and in general it is interesting.

Java: xml Parsing [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... I want to see the simplest and most compact xml parsing algorithm in java. Any libraries, classes. m?

How do I rotate a triangle?

I draw an isosceles triangle in the middle of the screen on Canvas. I draw from the center of the triangle (the intersection ... he rotation are calculated incorrect. What am I doing wrong? How do I calculate the new coordinates after turning a triangle?

BPM development (specifically Pega) or automated testing in Java, which to choose?

Good day to all! I will describe the situation. 22 years old, 3rd year of finance faculty, school21, I have basic skills and ... ty factor than the sum of the po. Thank you to all who responded! Ps do not judge strictly if you wrote nonsense somewhere

Output of a two-dimensional array. Java

I created a new method and wrote the following in it: static void changeDiagonal() { System.out.println("Задание №4"); ... oes not start with a new line, but we would like it to. Tell me, please, what can there be another way to output in 10 lines?

How do I find the product of all the elements of a two-dimensional array?

In the product, it always outputs 0. Everything is fine with a one-dimensional array, but when working with a two-dimensional ... ; 3; i++) for (int j = 0; j < 3; j++) r = r * a[i][j]; System.out.println(r); } }

They don't start.jar files exported to Eclipse

I exported my project to a runnable jar file in Eclipse. Correctly specified the input class. All libraries added. The file does not start. Another jar file that I once made in netbins runs without problems. What to do?

Java Constructors

Hello everyone! There is a basic constructor: public abstract class JS { public Context context; public JS(Context ... there is no constructor with such parameters... Please tell me why? In other object languages, this works, but not in Java..

How do I programmatically disable the dark theme in an Android app?

On the new Android, the function of enabling a dark theme for the entire device is available and, accordingly, adapting appli ... terrible and impractical. Is it possible to somehow disable the forced adaptation to dark theme programmatically in the app?

How do I output a multidimensional array to the console?

Created a multidimensional array (3x5), now you need to output it to the console. How can I do this? public class Map { p ... } public class Main { public static void main(String[] args) { Map map = new Map(); map.see(); } }

Drawing an image rotated in the direction of movement | Graphics | Graphics2D

It is necessary to draw the image rotated in the direction of movement (the rotation should be relative to the center of the ... e to the center and the rotation is incorrect Details: I draw on JPanel in the method paint(Graphics gr) Using Graphics2D

Timer in Java Swing

How do I create a timer that will perform an action after a given time has elapsed? For example, you need to say System.out.print("Hi!"); after 4 seconds

Working with the Repository pattern

A common task is getting data. For example, I get profile data from the server. After receiving it, I cache it to local memor ... in which they write that you do not need to do the SAVE, Update methods in repositories, but I do not quite agree with this.

The task of the Chinese postman. Finding the Euler cycle

At the university, they were asked to solve the problem of the Chinese postman.Here is the algorithm for solving it. We loo ... length; i++) { if (matrixAdjacency[edge][i] > 0) { return i; } } return -1; }

Error 1603 when installing Java 8+ 86/64 on Windows 10 1903 x64

Windows 10 Pro 18362.356 x64 (not build-litsuha) I tried it: 1) From admin/in compatibility mode 2) Restart the computer a ... s the 8 version. But the installation problem, i.e. the error was also on a clean Windows, where java is not in sight it was.