English

Creating a class object in Java

I started to understand polymorphism and found the following example: there is a class Soldier, and General is its heir. The ... tHealth() ? And if the getSlogan() method was in the soldier, would such a call be possible? And this is due to polymorphism?

Java. Read lines from a file

Hello. Please help me. You need to read from the .txt file the lines that look like this: 14 Февраля 10 Декабря 22 Июня ... ... .nextInt(); String tempMonth = sc.nextLine(); theTree.insert(tempDay,tempMonth);//вставка данных в бинарное дерево }

When may I need to load classes in java myself?

Please help me understand the dynamic loading of classes in java. As I understand it, when the program starts, classes are lo ... te an object), the JVM will load it itself. And when it may be necessary to do this using the ClassLoader.loadClass() method?

How do I split a string into words so that only alphanumeric characters remain in the words?

For example, there is a string like this: String text = "The urn was then carried for several rounds around the cremation sit ... is necessary to make a regular expression ? Or you can delete the characters without it punctuation and special characters ?

How do I apply the clone() method of the Object class?

The code I wrote for training: class Korobka { public double width, depth, height; //Объявление переменных public ... m the Object class. Questions: Can I apply this method, for example, to the k1 box (for cloning)? If so, how do I do it?

Replacing characters in a Java string

The string = string.replace("a", "b"); method will replace all the letters. But what if you only need to replace the free-standing ones? That is, we change"а", and "aa" remains standing. Is there a way to implement this somehow?

Problem with selecting the system JRE

Hello everyone I installed a developer kit in the Java programming language under version 14.0.1 (JDK 14), initially correc ... uld like to have multiple versions of the JRE on the machine, as there is a real need for this. Please help with this issue]1

How to organize Random without repetitions in Java?

There are numbers from 0 to 23. How do I make it so that when you click on the button, a random number is generated that does not occur at least 2 more times?

Why do I need static non-nested classes?

Why do I need static non-nested classes?

Why do we need and as method parameters

There is a function: <R> Stream<R> map(Function<? super T, ? extends R> mapper); It performs operations ... fter all, we just pass the implementation with specific T(User) and R(String), where can we use subclasses and superclasses?

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 find out and change the java version in Android Studio?

In Intelij IDEA, you can do this by going to Progect Structure-Progect (if, of course, I correctly interpret what I see): But in Android Studio, when you follow the same path, there is a completely different information:

How do I clear the browser cache via javascript?

There is a page, when the user visits it, the page should be loaded from the server, and not from the cache. Is it possible to clear the cache via javascript? Or make the page load from the server without using the browser cache?

What is a jar file and why do I need it?

The question is what is a jar file and why it is needed in practice. After all, if there is a file java, there is a file class that is already translated into bytecode, then why jar file? What is its function and is it possible to do without it?

Java block synchronized

I'm trying to synchronize the object ArrayList in the synchronized(){} block. In a separate thread, I capture this object in ... nchronized { public ArrayList<String> al; CheckSynchronized() { al = new ArrayList<>(); } }

Passing by value in Java

Good afternoon. I read about calling by value and came across two examples. 1st: public class Application { public stati ... his example ? Because String is a class, not a type in Java, and in both examples we create an instance of the String class.

How to check the validity of CSS code entered in a form via JavaScript

The text CSS is entered in the form, you need to check its validity on the browser side, or throw out everything that is not ... the same form as you add it without corrections. Apparently, you need to extract it in some other way, not through the dom.

The term Java Collection framework

The Java collections framework (JCF) is a set of related classes and interfaces that implement widely used data structures ... hat Collections are ala data structures (List, Set, Queue), and Collection Framework is what then turns out? I'm confused ...

Spring Lessons

Please recommend good literature or video tutorials on Spring Boot for advanced study in Russian. A detailed explanatory book.

How to determine the width and height of the phone screen in java?

How to programmatically determine the width and height of the phone screen in java?