Java区分大小写吗? [英] Is Java case-sensitive?

查看:288
本文介绍了Java区分大小写吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在某处读到Java区分大小写。我一直无法证实这一点。是吗?如果是这样,为什么?

I read somewhere that Java is case-sensitive. I have been unable to confirm this. Is it? If so, why?

推荐答案


我读到Java区分大小写的地方。我无法确认这一点。

I read somewhere that Java is case-sensitive. I have been unable to confirm this.

Java源代码区分大小写,如果你的意思是。 ie Double double 的类型不同,你可以有两个不同的单独变量 myData mydata

Java source code is case sensitive, if you mean that. i.e. Double is not the same type as double, and you can have two different and separate variables myData and mydata.


是吗?如果是这样,为什么?

Is it? If so, why?

在大多数编程语言和环境中,区分大小写是常态,因为大写和小写字母的表示方式不同最低级别。对于计算机来说,a和A是两个完全不同的东西,它需要额外的工作才能使它看起来像是一样的。

Case sensitivity is the norm in most programming languages and environments, because lower and upper case letters are represented differently at the lowest levels. To a computer, "a" and "A" are two completely different things, and it takes extra work to make it act as if they were the same.

此外,某些语言对套管有非常棘手的特殊规则,例如:德语字母ß没有大写版本,通常大写为SS - 所以weiß和WEISS应该被认为是语法相同吗?更糟糕的是土耳其语:他们有两个单独的字母,有和没有点,每个都有自己的大写版本。所以在土耳其,IMAGE不是图像的大写版本!这根本不是无关紧要的,特别是对于Java,因为如果你愿意,你可以在Java程序中实际使用所有这些字母作为标识符。

Furthermore, some languages have very tricky special rules for casing, e.g. the German letter ß has no uppercase version and is typically uppercased to "SS" - so should "weiß" and "WEISS" be considered syntactially identical? Even worse is Turkish: they have two separate letters i with and without a dot, and each has its own uppercase version. So in Turkey, "IMAGE" is not the uppercase version of "image"! And this is not irrelevant at all, especially for Java, since you can actually use all these letters as identifiers in your Java programs if you want.

根据所有这一点,编程语言设计者会选择语法区分大小写的简单解决方案是非常容易理解的。

In the light of all this, it's very understandable that programming language designers would choose the simple solution of having the syntax be case sensitive.

这篇关于Java区分大小写吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆