Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. QA Testing
  3. Question
QA Testing

Explain when and where one should use all the different data types while creating variables?

Asked by Vaibhav Mishra Dec 28, 2019 1.6K views 1 answer
Share

Your answer

1 Answer

Ashish Mishra JanBask Expert Latest answer

Answered on Nov 7, 2019

As we know there are different data types and while you are learning data types in order to learn a new language, one should be aware of when to use them and how.

Different data types are: int, short, Boolean, long, double, char, float, String, byte to name a few.  

  1. If you are declaring numeric values, you can use any of this depending upon your need and precision: int/short/long/double/float/byte. 
  2. If you are declaring a variable with answer to it as Yes/No, true/False, 0/1, in this case you need to make the data type of variable as Boolean. 
  3. If you need to store some text, in that case you can use, String or char to define your variable. 


Was this helpful?

More QA Testing discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest QA Testing Blogs

Guides, tips and career advice on QA Testing from JanBask experts.