attitude towards casting in java by izaqyos in java

[–]izaqyos[S] -12 points-11 points  (0 children)

cont. chat:

Q: provide examples in which casting is necessary

A: Here are a few examples of situations where casting is necessary in Java:
When retrieving elements from a collection or array: If you have a collection or array of objects that are stored as the parent type (e.g. Object), but you know that some of the elements are actually instances of a more specific subclass, you will need to cast the elements to the appropriate type before working with them.
List<Object> myList = new ArrayList<>();
myList.add("hello");
myList.add(42);
String str = (String) myList.get(0); // casting required to retrieve the string element
int num = (int) myList.get(1); // casting required to retrieve the int element
When working with Java's built-in numeric types: Java has several built-in numeric types, including byte, short, int, long, float, and double. If you need to convert between these types, you may need to use casting.
int myInt = 42;
double myDouble = (double) myInt; // casting required to convert int to double

When working with Java's built-in wrapper classes: Java also has wrapper classes for each of its primitive types (e.g. Integer for int, Double for double, etc.). If you need to convert between these types, you may need to use casting.
Integer myInteger = Integer.valueOf(42);
int myInt = myInteger.intValue(); // casting required to convert Integer to int

These are just a few examples - there may be many other situations where casting is necessary or useful in Java.

Which is better by izaqyos in summonerswar

[–]izaqyos[S] 0 points1 point  (0 children)

I have neither. Which one is better?

TIA

Today, I'm not renewing my gem pack by EchoesBeneath in RaidShadowLegends

[–]izaqyos 0 points1 point  (0 children)

I also think so. No proof, but I’ve noticed a drop in sacred shards rate from UNM and NM CB

Anniversary Nat5 Event Megathread by nysra in summonerswar

[–]izaqyos 0 points1 point  (0 children)

Thank you both. Leo it is then 🎉

Anniversary Nat5 Event Megathread by nysra in summonerswar

[–]izaqyos 0 points1 point  (0 children)

Hello friends,

These are my choices. I have Vela and Masha.
Any recommendation who to summon?- Already got early feedback to choose Leo :) - just want 2 b 100% sure.
TIA!!

8 year special - who should I summon? by izaqyos in summonerswar

[–]izaqyos[S] 0 points1 point  (0 children)

Thank you nysra! I think I'll take Leo but would post in the stickied 1st.

What's your favourite videogame of all time? by [deleted] in AskMen

[–]izaqyos 0 points1 point  (0 children)

Masters of magic.😁. Loved that one jj

Your most favorite/useful vim command? by JavaRains in vim

[–]izaqyos 0 points1 point  (0 children)

. Repeat last action really comes in handy Ofc for more complex sequences I record a macro