Java answers

  • 1answers
    How to fix a bug in eclipse?
    I can't figure out what the problem is. Before, everything was fine, all programs are working. As I reinstalled Windows so eclipce does not start anything at all. Do you think the problem is in the eclipse or in java?
    Java Daniel Fox, Jan 29, 2019

  • 1answers
    How to get information from a page on the Internet using java?
    I want to get, for example, information from the weather website. And based on it, analyze what clothes should be worn. How do I get this information?
    Java Anonymous, Jul 27, 2020

  • 0answers
    How to do basic authentication correctly in Spring Boot?
    I screw basic authentication to the soap web service. With the following configurations service and security authentication does not work (the service responds to the request without an auth header). And with such configuration (the default messageDispatcherServlet is created) authentication ...
    Java Anonymous, Apr 14, 2020

  • 1answers
    How do I indent a button?
    Hello everyone. Can you please tell me how to indent a button? analog paddin? google many solutions like setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15)); or JBtn.setMargin (new Insets (5,5,10,10)); but they add an internal lack, but an external one is needed. I do not want to ...
    Java Cora Allison, Jan 8, 2020

  • 2answers
    Internships in outsourcing companies (St. Petersburg, Moscow time)?
    Good evening everyone. I have been working as a programmer for a small regional company for half a year. Education, unfortunately, is not IT, at the beginning of 2015 I decided to study programming, chose Java as one of the most popular and easy to learn, taught myself for half a year, then from ...
    Java Xavier Gordon, Jan 18, 2020

  • 1answers
    How to work with enum in Java?
    I got to the topic of transfers. And immediately from the first example, some troubles. An example is given. enum Apple { Apple1, Apple2, Apple3, Apple4, Apple5} public class App { public static void main(String[] args) { Apple apple; apple = Apple.Apple3; ...
    Java Anonymous, Jul 24, 2020

  • 1answers
    How to check the existence of a database?
    Kind The question is how to check if the required database already exists on the device? It is the database, not the tables. As a crooked option, always create a database at startup, if it exists, then catch an exception, but this is somehow stupid
    Java Lydia Cisneros, Jun 1, 2020

  • 1answers
    How to get data from javaScript in a servlet?
    Hello. Please help me solve the problem. Given a page After entering data into the fields and clicking on the sent button, I need the contents of the fields to go to the servlet array. I don't quite understand how to extract data from this javaScript and send ...
    Java Anonymous, Apr 28, 2020

  • 1answers
    How can I perform an operation on operands of unknown types?
    For example, let's take the operation +. You need a function like this: Object plus (Object left, Object right) {...} What: plus(1, 3); // = 4 (Integer)plus(1L, 3); // = 4 (Long)plus(1L, "test"); // = "1test" (String)plus(1, new Date()); // Exception
    Java Adalyn Wallace, Sep 5, 2020

  • 2answers
    What is the best way to organize a lazy image processing queue?
    I get images via php. Then they need to be cut / reduced. I want to make the thresher on a separate server with the possibility of making a pool of such threshers in the future. As well as a pool of servers that receive images and process logic. And so that you can pull / insert any server at any ...
    Java Arabella Beard, Jun 3, 2020

  • 2answers
    How to create a MySQL DB in Java?
    Kind I want the application to check for the presence of a database when it starts up, and in case of absence, a script to create a database (namely a database, not tables in the created database) in MySQL is executed. so I connect to the database private static final String test = ...
    Java Anonymous, Mar 6, 2019

  • 5answers
    GeekBrains - What and How? Whether it is necessary?
    Hello, the question is not being searched by a search engine, since since the last answers on those sites there have been changes in GeekBrains and I would like to know the opinion of people about what is happening there now (!!!) (in terms of the quality of training). Thank you.
    Java Anonymous, Apr 9, 2020

  • 0answers
    Do not all methods of the parent class use bridge methods when referring to an object of the inherited class?
    Good day. I read Horstmann's chapter on generalizations, it talked about how bridge methods work for generalized methods. (class Pair is just a generic class with two variable fields) class Datelnterval extends Pair<Date>{ public void setSecond(Date second){ if ...
    Java Anonymous, May 29, 2020

  • 1answers
    How to read serialized objects from file into ArrayList?
    I write objects to a file through a loop without problems, but I don’t know how to read them back, because after a new program start, we don’t know how many objects are in the file.
    Java Anonymous, Aug 16, 2020

  • 1answers
    How do I correctly specify JAVA_HOME in tomcat?
    Hello everyone! I am trying to install tomcat under ubuntu using this manual https: // ... Everything seems to be more or less clear, but in the end the server does not start. sudo initctl start tomcat outputs to the console: tomcat start / ...
    Java Zoey Krause, Mar 15, 2020

  • 1answers
    How to specify variables correctly in Kotlin?
    Good day. I use Kotlin and Spring. Tell me how to work with variables correctly (in the structure below) to avoid constant checking for NULL and prescribing "!!"? There are such variables in the class. @Autowired var newsModules: NewsModules @Autowired var usersModules: ...
    Java Declan Elliott, Jul 15, 2019

  • 0answers
    How to properly revoke authorization after token expiration?
    There is an authorization service for Spring Security public void configure(ClientDetailsServiceConfigurer clients) throws Exception { clients.inMemory() .withClient("...") .secret("...") .autoApprove(true) .authorizedGrantTypes("password", ...
    Java Anonymous, Oct 28, 2020

  • 2answers
    How does Tomkat compile JSP?
    Good afternoon. Can you please tell me how tomkat compiles jsp into class files? Interested in exactly how he does it technically? Translates code to Java and then calls javac? But there seems to be no javac in the JRE. In general, how?
    Java Rosalie Snyder, Apr 10, 2019

  • 0answers
    Why can we only expand the visibility of the access modifier of the overridden method?
    This refers to cases similar to those of overriding the clone () method of the Cloneable interface. It seems to be not quite a beginner, but for some reason I cannot put together a final and well-formulated goal. I understand that here we are talking about polymorphism and the fact that when ...
    Java Iris Flores, Jun 5, 2020

  • 0answers
    Is this version of the singleton absolutely safe?
    Can you please tell me if this version of the Singleton pattern is safe? Is it possible to undermine it with the help of reflection, or in some other way? public class MySingleton implements Cloneable{ private static MySingleton mySingleton = new MySingleton(); private MySingleton(){} ...
    Java Anonymous, Sep 9, 2019