java

REST API Implementation

The other day, for the sake of interest, I threw a resume to the company, sent a preliminary test. It is said to implement a ... tations of this (for any task, not necessarily working with files) are there in C# / Java? I will be grateful for any answer.

Parsing a site in java using jsoup

I decided to write a simple TV program using jsoup. The task is more than boring, but for me it is new because I have not wor ... schedule from the first channel on the page. And maybe you think that jsoup is a complete mess, please advise another one.

HashMap Thread Safety in Java

I have met many articles where they suggest using java.util. HashMap from different threads as a completely possible option, ... ronized, if the threads don't know about the Map change, since its fields are not volatile. Please help me clarify the point!

How are enumerations implemented in Java?

Recently, I have been asking questions about the implementation of some data types that are actually part of the language its ... for self-development, as I really like to understand what is "under the engine". Thank you all so much for your help! :)

Dimensions of data types in Java

In the book "Java 2. The Most Complete Guide" by P. Knowton and G. Schildt, the following is said about the size of data type ... ord behavior of variables of integer type and whether it is true that for variables, not declared as arrays, size undefined?

Why add super () to the constructor of a child class if the compiler does it automatically?

Why add the super() call to the child class constructor if the compiler does it automatically? I mean, in any case, the constructor of the parent class will be executed first, and only then the child class, so why write it manually?

Intellij idea and java 7

Hello. There was a problem, I installed java 7, but I can't configure idea for the new version. For example, if you use Strin ... tring s = in.nextLine(); switch (s) { case "qq": System.out.println(1); break; } } }

Autocompletion in Intellij Idea

Tell me how to implement such a feature in Intellij Idea: I type four letters "psvm" and get this sentence public static void main(String[] args){} For auto-completion?

Count the number of occurrences of each word in the file

You need to write a program to count the number of occurrences of each word in the file using the stream api.

Java. Android Studio.Running the service in the background without notification

Hello everyone, please tell me how to start the service in the background without notification in the app? And what does it m ... "Service is running background") .setContentIntent(pendingIntent) .build()); } Thank you in advance.

Question on OOP non-static variable this cannot be referenced from a static context

Hello everyone, an error occurs: "Error:(6, 21) java: non-static variable this cannot be referenced from a static contex ... t like this: public static class Car Can anyone help explain this problem? Are there any other ways to solve this problem?

Why is Entity a POJO class?

On Wikipedia, black on white says: Entity - a POJO class associated with the database using an annotation (@Entity) or vi ... an that the Entity class should be POJO exactly before it is turned into an Entity? Or is there something I don't understand?

Why do I need Throws in exceptions?

Maybe I'm asking a stupid question , but I really don't understand why you need throws if there is a try and catch? After all ... nothing it does not handle the exception but simply throws them So why do we need throws in exceptions? Thank you in advance

Java finally

Hello. What is the difference between using finally and putting the code just after the try-catch block? That is, instead of ... the word return in the try and catch blocks, and in the finally block of actions that are mandatory at the end of the method.

The this keyword

Please tell a novice what does this mean in this code block? I am interested in this line t=new Thread(this); class Callm ... ob1.t.join(); ob2.t.join(); ob3.t.join(); } } This is an example from Schildt on using threads...

The volatile keyword in Java

Today I met this code class someClass { // ... private volatile int a; // ... } The question is, what is volatile in this context?

Using a ready-made SQLite android database

I need to output data in a ListView (or better yet, in a RecycleView) from a ready-made SQLite database. I tried to follow th ... tList = mDBHelper.getListProduct(); In DataBaseHelper: Cursor cursor = mDataBase.rawQuery("SELECT * FROM PRODUCT", null);

JUnit test for void function

We need to test the function JUnit with tests: public static void get() { Scanner scan = new Scanner(System.in); try ... @Test(expected = InputMismatchException.class) public void test() { // ? } Please tell me how to implement this?

OOP in Java. Does abstraction relate to the principles of OOP?

I wanted to ask, does абстракция apply to the principles of OOP? Why on some resources only: наследование, инкапсуляция, полиморфизм?

Interfaces in OOP (Java), in a simple way?

Explain in a simple way, on your fingers, why and why you need interfaces (Java)? All these abstruse book definitions and formulations, do not add clarity at all.