"Hei, soldat!"

"Hei, kaptein Squirrels, sir!"

"Jeg har gode nyheter til deg. Her er noen øvelser for å forsterke ferdighetene dine. Arbeid med dem hver dag, og kompetansen din vil vokse eksponentielt. De ble spesialdesignet for IntelliJ IDEA.

5
Oppgave
Java Syntax,  nivålekse
Låst
Cat and statics
The sun rises. The tasks get more complicated: let's study the static keyword. This time, we need to create a static variable catCount and a constructor in the Cat class, i.e. public Cat(). Each time a cat (new Cat object) is created, increment the static variable catCount by 1. We need to create ten cats and display the value of the variable catCount on the screen.
10
Oppgave
Java Syntax,  nivålekse
Låst
Static cats
A static cat is every cat's cat. So, in this task let's add a static variable cats to the Cat class. Each time a new cat (new Cat object) is created, let it be added to the variable cats. We need to create 10 Cat objects. Then the printCats method should display all the cats on the screen.
2
Oppgave
Java Syntax,  nivålekse
Låst
Feng Shui and statics
An expert in feng-shui programming looked at the code for a few seconds, lifted one eyebrow, and nodded while solemnly saying: "I found an error in the location of the modifiers in this code. You need to rearrange one static modifier. Then everything will be feng shui. The example will compile. Harmony will be restored".
5
Oppgave
Java Syntax,  nivålekse
Låst
Minimum number of statics
Warming up the brain is useful, and this is done best with puzzles. But because we're programmers, we put puzzles right into the code. Here you go: for this task, you need to place the minimum number static modifiers necessary to make the code start working and the program complete successfully.
5
Oppgave
Java Syntax,  nivålekse
Låst
Notepad for new ideas
Great ideas need to be written down or they can be forgotten very quickly. To help with this, in the Solution class, create a static Idea class. Give it a public String getDescription() method that returns any non-empty string. Then create a static public void printIdea(Idea idea) method that displays a description of the idea.
2
Oppgave
Java Syntax,  nivålekse
Låst
KissMyShinyMetalRearActuator
On Planet Wild Robots, nobody is taught to write or program. That's why when Robot A was taken from his natural environment and moved to a space ship, it turned out he couldn't even sign a contract. Let's help Robot A: create a class called KissMyShinyMetalRearActuator for signing contracts.
2
Oppgave
Java Syntax,  nivålekse
Låst
Three static name variables
If static variables are not abused, they are extremely helpful. In general, they need to be understood, cherished and tenderly cared for. Now you get code where some classes have already been implemented. Your task is to add three public static variables to the code: String Solution.name, String Cat.name, String Dog.name.

De forrige øvelsene var for nybegynnere. Jeg har lagt til noen mer avanserte bonusøvelser for de gamle. Bare for veteraner."

2
Oppgave
Java Syntax,  nivålekse
Låst
Fixing the mistakes of youth
Sometimes a coder works on a project and does his best. He opens someone else's module and finds that not only does it not work correctly, but it doesn't even compile. This can't be avoided at companies with more than one coder. That's why you need to learn to read and debug others' code from your earliest days as a fledgling programmer. Make this program display the maximum of the two entered numbers.
10
Oppgave
Java Syntax,  nivålekse
Låst
Cat relations
Finished task: A cat has a name and a mother. Create a class that reflects this. Create two objects: a daughter cat and a mother. Display them on the screen. New task: Each cat has a name, a father, and a mother. Edit Cat so that it reflects these relationships. Create 6 objects: grandfather (the father's father), grandmother (the mother's mother), father, mother, son, daughter.
10
Oppgave
Java Syntax,  nivålekse
Låst
Ascending numbers
Perhaps you've already heard about the ordered isomorphs from Planet Linear Chaos. You know, the ones who invented every sorting technique? Today we've received a task from them: the user enters 5 numbers from the keyboard, the method sorts the numbers in ascending order, and then another method displays them on the screen. Are you up to the challenge? If so, maybe you should visit Linear Chaos!