java

Calling a function from another java function

Good afternoon, everyone. Task, calculate the sum of the entered numbers in a given range and the arithmetic mean. Display al ... Сумма чисел " + sumOfNumbers); System.out.println("Среднее арифметическое " + arithmeticalMean); } }

JUNIT tests in a multi-module Spring Boot project

There is a Spring Boot multi-module application, with db configuration via JNDI, how to run Junit tests correctly? My test is ... ceLookupFailureException: Failed to look up JNDI DataSource with name What else did I miss or maybe I'm doing it all wrong?

Where does gradle go for org. springframework. boot

When loading the project, the message Plugin [id: 'org.springframework.boot', version: '2.2.2.RELEASE'] was not found ... BUILD FAILED in 1s 28 01 2020: Launched from the project folder bootrun 29 01 2020 Launched gradlew bootrun. Result:

How do I record audio from a microphone and play it back?

How do I record audio from a microphone to a buffer and play it back? And how do I write it to a flac file afterwards?

Testing rest java

I would like to know how to properly test rest services.For example, I want to test the post and get methods of some service ... use post.I heard it's not a good one approach.What should I do in this situation?I will be happy for any help and resources.

"Recent Apps" in Android

There is a button. You need to open "recent applications"when you click it. How? Intent, I think?

Method with StringBuilder parameters

There is a task in which you need to create a method and enter two objects of the StringBuilder class in the parameter input. ... System.out.println(check2); // Test 3 - check method Homework.equalityTest3("Test1", "Test1"); } }

How to properly work with Cookies in Android

I am implementing a request to the server that sets the PHPSESID in the cookie, I am doing it like this: response = h ... ve cookies every request, is there a way to do this as in the browser, they were installed themselves without my supervision?

Java Graphics

Good day, hashkodovtsy! I don't even know how to start the question, in general, my code doesn't work with Java Graphics. No ... aint(Graphics g){ g=(Graphics2D)g; g.setColor(Color.BLACK); g.drawLine(20, 20, 360, 20); } }

Working with javax. comm on linux

Hello. Does anyone know how to properly install javax. comm in ubuntu? I need this library to work with COM ports. In the Int ... to install RXTX. Maybe someone knows the current tutorials on installing this good in Linux? Linkanite or tell pliz. Thanks.

Java. Creating a random object from a list of parent subclasses

Java 11 Is it possible somehow, without specifying a specific class, to create a random object from some, perhaps, list? Pe ... lass, and then get all the subclasses of this interface: UnknownInterface.class.getClasses(), but it returned an empty array.

Optimizing the Android Studio IDE (JetBrains)

I program for Android on a very weak laptop (Ubuntu Linux OS) under Android Studio (a fork of IntelliJ IDEA, if you can put i ... luous? In addition to the animation of windows and some icons, I did not turn off anything. Thank you so much for your help!

Types of variables

If a variable is declared in the class body and is static, then it is a variable of the class If the variable is declared in ... int k;} static{int k;} } Additionally: it is not allowed to declare variables in such brackets with the keyword static.

Postgresql JDBC Maven. Does not connect to the database after the build

I started studying JDBC and ran into this problem: I wrote a simple program in IntelliJIdea that tries to connect to a Postgr ... equires accounting and, possibly, payment. Or is it possible to somehow run a project written in 11 and higher using jre 8?)

Upload an image and get a link to it piccy.info

You can somehow upload the image to piccy.info and get a link to it? Or maybe there is some tried and tested way to upload an image to some hosting site and get a direct link to it, in automatic mode?

Unary plus

The question on the topic of the day: what is the unary plus for? I thought for a long time, but I didn't find anything usefu ... dummy c = + b; //вот тут случайно опечатались, должно быть a + b } Update: what if you can't overload it? (Java for example)

JDK version for Android development and current API levels

I am a beginner, so I ask you not to throw your slippers at once, but to explain for the teapot or give links to sources of c ... Liberica JDK?) What is the lowest API level that makes sense to study, otherwise what API levels are relevant at the moment?

Problem when running selenium driver java code

import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.Session ... verService.java:94) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123) at sel1.main(sel1.java:9)

TomCat error: SocketTimeoutException: Read timed out

I'm learning spring, trying to make my first bean. When I try to run the application in eclipse, everything is OK. When I try ... ll you how to solve the problem? Or an article suitable to throw off. I haven't found a solution anywhere that would help me.

The simplest servlet.HTTP Status 404 error

Error 404 occurs. Previously, everything worked correctly. I tried different possible variations, used different tomcat, trie ... act is deployed successfully [2020-02-26 02:33:05,758] Artifact TestServlet:war exploded: Deploy took 578 milliseconds