swarna savvy

Greenhorn
+ Follow
since May 23, 2020
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by swarna savvy

Can someone please help me to understand this. am new to Java .

Short s3=10;  //compiler is ok with this because narrowing conversion happens and then autoboxing happens.
Short s5= Short.valueOf((short) 4);  //here explicit cast is needed  , why ?

Long l =(long) 10; // here explicit casting is needed
Long l2= Long.valueOf(10); //but here no casting is needed . why?

little confused ..
3 years ago