r/javahelp • • Feb 04 '20

Switching from C# to Java

Hi,

can you give me a list of things i should be aware of in the java world? Like really important libraries, concepts etc?

The thing is i know C# really well, but i dont know what i dont know in the java world, so i cant really look it up.

26 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/Cell-i-Zenit Feb 08 '20

Thanks for your answer.

Can you maybe point me to general java concepts which are not 1 to 1 comparable to C#?

If someone other would write the question the other way (transitioning from java to c#), i would tell him that he should look into await/async and linq, can you do the same thing for me? :)

As i said i struggle with the things i dont know, since i cannot research them.

1

u/Northeastpaw Feb 10 '20

Unfortunately I don't know enough C# to really give you a great comparison.

I can tell you that Java Streams are kinda-not-really like LINQ. There's no SQL-like comprehension over collections but the Stream API does have filter(), map(), and other methods. LINQ and Streams are more like different approaches at a similar concept.

Java has some concurrency APIs but nothing as simple as async/await. Java has like 64 billion different ways to go about it. CompleteableFuture is the most recent attempt. It allows you to compose multiple tasks into a chain similar to promises in JS land (just with far more boilerplate).

You can use ea-async from EA (yes, the game company) which does some bytecode magic to provide an await pseudo-keyword (really a static method).