I also prefer C# to Java, but there are reasonable arguments for Java. While the language is inferior, the Java ecosystem is superior to .net, and this might be more important.
This depends a lot on what you want to do in your program. Of course, for example, for interacting with other Microsoft technologies, .net has a better ecosystem.
About as easy as Python, at least.
Which, for MS, made a lot of sense, they wanted to hook win32 apis. Java doesnt care, as much...
unsafe
{
[DllImport("libc", EntryPoint = "write")]
static extern nint Write(nint fd, byte* buf, nint length);
var text = "Hello, World!"u8;
fixed (byte* ptr = text)
{
Write(1, ptr, text.Length);
}
}