Noticed that I have to resort to saving this "card" element into a reference data type "draw" before removing it and then return this "draw" to the main method calling it. I've tried the alternative that's

draw=cardList.remove(g;
return draw;

but didn't worked.

I wonder if theres a more efficient method in doing it, like to remove and capture the card at the same time and save to draw... or just do both of that and return the card without even using this "draw" thing.

In order to mimic real-world card game I also wanted to implement a function which would remove the "card"[object] from player's hand[arrayList] so if theres any shortcut method it would make the code a lot shorter.

Actually Norm I just wanted to find a way to get the removal and adding/displaying done more efficiently.

The getCard method will take in an integer value from main() and check whether the cardList has this element, if it does then it will run this 3 lines :
if (g>= 0&&g<cardList.size()){
Card draw=cardList.get(g);
cardList.remove(g);
This is to get the specific card at intg position.

If not it would return a null value.

I've tried a few possiblities to shorten the code, making it more efficient. Such as:
draw=cardList.remove(g);
return draw;