Arnold Gatmaitan

Greenhorn
+ Follow
since Jul 31, 2012
Arnold likes ...
IntelliJ IDE Spring Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
12
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arnold Gatmaitan

Question:

For a top‚Äźdown migration, all modules other than named modules are ____________ modules and on the ____________.



Options:
A. automatic, classpath
B. automatic, module path
C. unnamed, classpath
D. unnamed, module path
E. None of the above

At Appendix the correct answer given is Options B.

Filling in the blank using B: "For a top-down migration, all modules other than named modules are automatic module and on the module path."

I thought this is a trick question and my understanding is that named modules will not be on the module path and the answer should be E.

Paul Clapham wrote:That snipped compiles just fine for me (I just tried it). Perhaps you're confusing compiler errors with runtime errors? The compiler doesn't throw exceptions when it reports on errors.



Yes I got confused! I am using single-file source code and were compiling and running in one go.

java Test.java



Question is:

Which of the following code snippets about var compile without issue when used in a method? (Choose all that apply.)



Options:
A. var spring = null;
B. var fall = "leaves";
C. var evening = 2; evening = null;
D. var night = new Object();
E. var day = 1/0;
F. var winter = 12, cold;
G. var fall = 2, autumn = 2;
H. var morning = ""; morning = null;

Answer in the book: B, D, E, H.

But option E (var day = 1/0;) will result to a compilation error. -> java.lang.ArithmeticException: / by zero
Hi,

All the definition that you have listed are correct.

You might want to add:

Two Types of polymorphism:
   * Runtime polymorphisms (overriding of functions )
   * Compile time polymorphisms (overloading of functions )

Covariant return types - different return type for a overriding method

Hope this helps.
Thank you for your reply. Sure, I will research deeper with the AOP concepts.

Another question with one of Spring AOP feature, "introduction" on when we can introduced s new method. When we will usually need to do this?

I have attached an image representation.
2 years ago
Is there a way for maximumRedeliveries and redeliveryDelay value to be dynamic per request/exchange. Values can be pulled from the exchange content header or properties.



Thanks in Advance!
What are the real world or common scenario where we need or want to use AOP introduction or adding new method/functionality to an object. In Spring case, on a bean.
2 years ago
Hi Junilu. Thanks you for your answer. This also means on compile time production and test classes are combined in their respective packages.

Junilu Lacar wrote:It has to do with the package declarations and the classpath settings when you run your tests.

By convention, the package structure that you create under src/test mirrors the package structure under src/main. You also declare your *Test classes to be in the same package as the class under test. This way, you can even reference members in your production code that have package-private (default) access.

When running tests, the test class output directory is added to the classpath in addition to the production class output directory. As a result, even though the two may be entirely separate physical directories in the file system, to the Java Runtime as long as the classes are declared to be in the same package, they will be loaded and treated as being "together" in the same package.

4 years ago
Hi. I am curious why classes in src/main are visible to the test classes under the src/test in a maven project.

Are they combined on compile time and test classes are just removed when packaging the application?

Thanks in advance.
4 years ago
Hi Jeanne/Henry,

Thanks for your answers. It is rare to use that in objects but comparing to null and traversing to list is a great example.

I can sleep soundly tonight

Regards,
Alder
Hi Jeanne,

Thanks for your reply. Yes, commonly I encounter the .equals() method. But what is the common use of == method when it comes to objects. Is there a scenario or example why we should test if two object are equal?
This may sound very basic. I understand what equality means when tested with the == operator. But I am curious of scenarios, design and examples on why we should check if references are pointing to the same object using the == operator.
Just missed this post by a few days.

I am currently preparing for an OCJP 1.6 certification.

Good luck to all of us

Thanks!