Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Junilu Lacar

+ Follow
since Feb 26, 2001
Junilu likes ...
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
Columbus OH
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt Green check
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Junilu Lacar

Knock yourself out
15 minutes ago
It's a simple Hello World program.
44 minutes ago

Nick Deluca wrote:Yup turns out I needed to recompile, which is weird considering I thought I already did...
Guess it was just a mistake on my end. Thanks!

You need to recompile every time you change your source code if you're going to run your program like that.

The other way to run it is in single file source mode where you just do this directly: java packageb/

If you run it this way, the program will be compiled in memory and there won't be .class file created in the file system by the compilation process.
9 hours ago

Carey Brown wrote:You can verify this by the assertions of the rectangle intersections.

You can also infer it from the calculations of TopLeft and BottomRight.
11 hours ago
You haven't declared the package in ClassB. Try adding a package declaration as your first line. Without it, ClassB will be in the default package.
20 hours ago

Vlad Timoshuk wrote:

Problem is that when i run this code every time i get FALSE

Have you tried drawing this out and checking your conditions?

This shows a scenario where the conditional on lines 50-51 is true for both subexpressions. Your code will return false for isIntersects() when clearly the two rectangles intersect.

20 hours ago
The name isInside() is confusing. Look at other classes/interfaces like List, for example. List.contains(value) will return true if the list contains the given value. When you read myList.contains(someValue), it makes sense. However, in your code the logic is reversed. It says "rectangle is inside point."  You might want to rename that method to "contains" or "includes" or something to that effect.

I didn't read the entire thread yet but it would seem to me that you just need the coordinates of two diagonally opposite vertices of the rectangle to check if a point falls within or on its bounds.
1 day ago
hmmm, I've always said "vahr" rhyming with "thar" as in "thar she blows!" and args like the pirate sound.

I'll add one to the mix: enum. Do you say ee noom or ee numb? I use the latter. And, yes, I know it's ee-noom-er-ay-shun but I say ee-numb anyway for the short version.
3 days ago
Why would you want to remove all blank lines? What do you think you're saving by doing this?

Whitespace is important in a program, especially when used judiciously. Whitespace makes your program easier to read, it helps you separate things that logically belong together from other things, and it helps make the structure of your code easier to discern.

Code without any blank lines at all would be horrific to read.
4 days ago
Please clarify -- it's not clear what you're asking or what kind of problem you're trying to solve. Give more details.
6 days ago
Any behavior that's more involved than just returning a field value or setting a field value. Something like "getDescription()" or "getID()" is not interesting. "Calculate total" or "Apply discount code" is more interesting.
1 week ago
One thing I try to avoid doing early on is anything to do with the frontend. Frontend is more difficult to unit test. I prefer to test my model and service objects. I prefer focusing on interesting behavior. If I were doing that exercise, I would probably just focus on things like "Add item to cart" and "Count items in cart" first. To me, the more interesting object to start with would be a Cart object. I wouldn't care about UI-related concerns until much later in the process.
1 week ago
I suggest you try it out yourself. You don't learn how to swim by listening to someone explain how they do it or reading about how someone trains for a swim meet. You learn to swim by getting in the pool and actually trying to do it.
1 week ago

Monica Shiralkar wrote:And what would be that for example if you are to build an online shopping application.What would be the loop that would take less than 10 minutes ?

I don't see a point in your line of questioning. There are many things you can start with for a scope that large. What are you getting at? You are asking oddly specific questions and it's starting to feel like you're just randomly fishing for answers. What's your point?
1 week ago