本文介绍了对数据类型感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试更好地了解作业项目的数据类型.我知道变量的变化和常量保持不变,但是它们与数据类型char,int,double,string和date有何关系?

谢谢,所以这些数据类型char,int,double,string和date是根据程序中定义的类型数据使用的?

Attempting to get a better understanding of types of data for homework project. I understand that a variable changes and constant remains the same but how do they relate to data types char, int, double, string, and date?

Thanks, So these data types char, int, double, string, and date are utilized based on the type data defined in the program?

推荐答案


class Example1
{
public static void main(String[ ] args)
{
int x = 10;

System.out.println("value of x before overriding: "+x);
int y =20;
x=x+y;
System.out.println("value of x after overriding: "+x);
}
}



现在,常量是那些从程序开始到结束都不会更改其值的变量,任何试图更改常量值的尝试都会引发错误.
在上面的故事中,我说过,您的朋友必须很好地使用资源才能获得您的许可.Tahir有时必须进行类型转换,以获得所需的结果,您将在编程的其他章节中学习有关类型转换的信息...... .......

谢谢&问候
基:rose:

一旦发现有用,就对我的答案进行评分



now constants are those variables which do not change their values from start of the program till the end and any attempt to change the value of a constant will throw an error.
In the above story i said ur friend has to take ur permission for using the resources well Tahir sometimes variables have to be typecasted in order to get the desired result u will learn about type casting in the further chapters of ur programming............

Thanks & Regards
Radix :rose:

Do rate my answer once u find it usefull


这篇关于对数据类型感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 01:51
查看更多