This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Biniman Idugboe

Ranch Hand
+ Follow
since Jun 09, 2017
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
55
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Biniman Idugboe

Apology. Wrong context.  I retract my previous comment.
1 month ago
Thanks for the eeforts, Mr. Sandy Temp.  I could not find the Stream interface in java.util.stream. 
1 month ago
Guys, thank you.  The concept is a lot more clearer to me.
1 month ago
Perhaps this is the replacement for grepcode?  It is nice, but it will be nicer if it has a search or a find facility.  The background is kind of hard on the eyes. Pardon me!
1 month ago
jshell> new ArrayList<>() == new ArrayList<>();
$96 ==> false
jshell> new ArrayList<>().equals(new ArrayList<>());
$95 ==> true

It appears there is no end to the nuances.
1 month ago
Thanks you.  So, I take it that [ ] is the string representation of an instance of ArrayList. The Dog instance has a hashcode generated for it, but the ArrayList instance doesn't have a hashcode.  This would suggest that all instances of ArrayList have the same representation.  Without a hashcode, what would Java use to differentiate one instance of ArrayList from another instance of ArrayList?
1 month ago
Java people, please have a look at the newbie commands below:

jshell> Function<String, String> function = (String str) -> str.toUpperCase();
function ==> $Lambda$19/1750905143@6a41eaa2 
I suppose that means the variable named function references a lambda expression that implemented and instantiated the Function interface. 
The identity of the lambda expression is 19/1750905143 and the instance it created resides at heap address 6a41eaa2.

jshell> class Dog{}
created class Dog

jshell> new Dog();
$10 ==> Dog@7d9d1a19 
Again, I suppose that means the variable named $10 references a Dog instance which resides at heap address 7d9d1a19.

jshell> new ArrayList<String>();
$11 ==> [ ]

jshell> $11.add("Hello World");
$12 ==> true

jshell> System.out.print($11);
[Hello Wolrd]

jshell> new ArrayList<>( );
$14 ==> [ ]  //Does not reference a heap address. Is this a fake instance?

jshell> $14.add("Hello World");
$15 ==> true

jshell> $14.add(new Dog( ));
$16 ==> true

jshell> System.out.print($14);
[Hello World, REPL.$JShell$21$Dog@548e7350]  // I see a heap address of the Dog instance, but no address for the String instance.
jshell> new String();
$18 ==> ""  //Does not reference a heap address. Fake instance?

jshell> new String("Hello World");
$19 ==> "Hello World" //Does not reference a heap address. Fake instance?

For the newbie that I am, the above is just confusing.  Are there instances that do not have heap addresses? 
I am obviously missing the points.  Nice if someone can explain the situation.
1 month ago
Noted with thanks.
2 months ago
Are Java designers going to correct this mistake?
2 months ago
So, I have the following:

jshell> Runnable r1 = ( ) -> Thread.dumpStack( );
r1 ==> $Lambda$15/1211076369@1593948d

jshell> Runnable r2 = Thread::dumpStack;
r2 ==> $Lambda$16/2015601401@4cc0edeb

jshell> Runnable r3 = ( ) -> Thread.currentThread( ).dumpStack( );
r3 ==> $Lambda$17/1551870003@39aeed2f

jshell> Runnable r4 = Thread.currentThread( )::dumpStack;
|  Error:
|  incompatible types: invalid method reference
|      unexpected static method dumpStack() found in bound lookup
|  Runnable r4 = Thread.currentThread( )::dumpStack;
|                        ^--------------------------------^
jshell>

Why is Thread.currentThread().dumpStack( ) valid and Thread.currentThread()::dumpstack invalid?  I am simply confused.
2 months ago
Thanks.
2 months ago
Thank you Sir.
2 months ago
Please, I need someone to explain the meaning of mutable shared state in a way a layman can understand it.
2 months ago
Thanks to everyone who has responded. Has grepcode.com completely gone off air or is this a temporary technical challenge?
2 months ago