Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Char default value - Enthuware question

 
Daniel Martins
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This is a question from enthuware:



Char default value is '' ....how does ba[ch] works?

The output is false false...

I do not understand how the ba['default char value'] works...
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you type cast ch to int you will get 0.
 
Daniel Martins
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are saying that the array will automatically cast the char to int?

Thanks
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Martins wrote:So you are saying that the array will automatically cast the char to int?

Thanks


Of course, array works on integer argument.
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this one you will have better idea:

 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
awesome....i love java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic