Give the example of mixing data type in java, JAVA Programming

Assignment Help:

Give the example of mixing data type in java?

Mixing Data Types
Order can form a difference while data types are mixed. For example,
1 / 2 * 3.5 = 0.0
3.5 * 1 / 2 = 1.75
3.5 / 2 = 1.75
You cannot assume in which the usual mathematical laws of commutativity apply while mixing data types, especially integer and floating point types.
1.0 / 2 * 3.5 = 1.75
3.5 * 1.0 / 2 = 1.75
1 / 2.0 * 3.5 = 1.75
3.5 * 1.0 / 2.0 = 1.75


Related Discussions:- Give the example of mixing data type in java

Java program to do the following operations:, Read information of n student...

Read information of n students. The class name should be kkhsou with the member variable name, rollno, center_code and percentage in last examestion.Display the students data whose

Session scope and Request scope, What is the difference among session scope...

What is the difference among session scope and request scope when saving formbean? Ans) When the scope is request, the values of formbean would be there for the current request.

What is the data normalization also define its goal, What is the Data Norma...

What is the Data Normalization? Also define its goal. Data normalization is to sort out complex data within easy form. It uses to simplify the complex information to form it mo

Convert encrypted hsql database into csv format, Project Description: We...

Project Description: We have an encrypted HSQL Database which we need to convert into CSV format. HSQL DB . We have java application jar file which reads that database but no

Which is better to store data as attributes or as elements? , A question ri...

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element. 1. Using  an  elemen

Give an example for using getter methods, Give an example for Using Getter ...

Give an example for Using Getter Methods ? class CarTest6 { public static void main(String args[]) { Car c = new Car(); c.setLicensePlate("New York A45 636"); c.setMa

What is the string concatenation, What is the String Concatenation + Op...

What is the String Concatenation + Operator is employed to concatenate strings - System.out.pritln ("Hello" + "World") will print Hello World on console String concatenat

Payroll calculator, how to write aprogramm that calculates gross pay, taxe...

how to write aprogramm that calculates gross pay, taxes, and net pay for both hourly and commission employees. It will then display those results to the screen

Explain the concept of multi-threaded- java, Explain the concept of Multi-T...

Explain the concept of Multi-Threaded- JAVA Java has a concept of concurrency wired right in to the language itself. This works out more cleanly than languages where concur

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd