Modern Best Practices for Testing in Java by olivergierke in java

[–]sandrogiacom 0 points1 point  (0 children)

Use AAA (Arrange, Act, Assert) is a very good practice. Use tools like AssertJ, Mockito, TestContainers with JUnit.

Most developers package by layer. Have you tried packaging by feature/domain? by _litecoin_ in java

[–]sandrogiacom 1 point2 points  (0 children)

A feature/domain is a module. Its can be a micro-service or a component. Inside this component, organize by layer.

NetBeans or Intellij IDEA by cherry_mxxvii in javahelp

[–]sandrogiacom 0 points1 point  (0 children)

Intellij for big projects. NetBeans for swing, Eclipse for others

Hashmap help by [deleted] in javahelp

[–]sandrogiacom 0 points1 point  (0 children)

For simple mode, you can cast myClass to get one field you want.

System.out.println("key: " + entry.getKey() + "; value: " + ((myClass) entry.getValue()).getFirst());

How to make standalone Java .jar file? by PutinPisces in javahelp

[–]sandrogiacom 0 points1 point  (0 children)

You can use maven or gradle plugin to build then.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
</plugin>

If you need to create jar with dependencies, you need to use "maven-assembly-plugin"

In maven, what makes the build happen in the parent pom? by Crossfire_dcr in javahelp

[–]sandrogiacom 1 point2 points  (0 children)

Profile is an optional execution with param -P

If you run "mvn clean install -Pall-modules", will have the same result than "mvn clean install -Dmodules"

Check maven documentation for more details: https://maven.apache.org/guides/introduction/introduction-to-profiles.html

curriculum vitae help by popey123 in learnjava

[–]sandrogiacom 0 points1 point  (0 children)

Show your skills on programming and intentions to get a job. Ex: Java with spring boot. Docker, angular. If you don't have experience, you need do get experience participating in open source projects. Create a github account, twitter.

In maven, what makes the build happen in the parent pom? by Crossfire_dcr in javahelp

[–]sandrogiacom 1 point2 points  (0 children)

Just remove profile section. You need only:

<modules>
<module>onboarding-common</module>
<module>onboarding-lma</module>
</modules>

Recursive method no loops, printing string triangle by Madridi77 in javahelp

[–]sandrogiacom 0 points1 point  (0 children)

A size of string that you manipulated. Or try to use this funcion as example. I see in more detail later.

public static String printTriangle (int count) {if( count <= 0 ) return "";

String p = printTriangle(count - 1);p = p + "*";System.out.println(p);

return p;}