首页题目详情

以下哪项是C#中定义常量的正确语法?

题目配图
A.const int x = 5;
B.int x = 5;
C.final int x = 5;
D.static int x = 5;

优质解答

答案

A

解析

在C#中,使用const关键字来定义常量,表示其值在编译时已知且不可更改。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

面向对象程序设计单选题中等AI生成