小编Ter*_*ice的帖子

声明"代表是安全的"是什么意思?

在委托的C#文档中,它说"委托是一种可用于封装命名或匿名方法的引用类型.委托类似于C++中的函数指针;但是,委托是类型安全且安全的 "

我的问题是,代表什么意思是" 安全 "?

.net c# security delegates

10
推荐指数
3
解决办法
2682
查看次数

以 f(x)(y) 格式调用 Python 函数意味着什么?

在本文中给出了以下代码行的示例:

 x = layers.Dense(64, activation="relu", name="dense_1")(inputs)
Run Code Online (Sandbox Code Playgroud)

这似乎是一个函数调用,它首先传入 64,然后传入两个命名参数,然后传入input.

这里发生了什么?是inputs被传递给layers.Dense还是别的什么?

python function python-3.x

2
推荐指数
1
解决办法
102
查看次数

当你用 {super.key} 声明一个常量构造函数时,这意味着什么?

我有以下基本代码

import 'package:flutter/material.dart';

//write the main method
void main() => runApp(const MyApp());

//write the MyApp class that extends the StatelessWidget class
class MyApp extends StatelessWidget {
  //write the const ctor
  const MyApp({super.key});
  //write the build method
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'hello',
        home: Scaffold(
          appBar: AppBar(
            title: const Text('hello'),
          ),
          body: const Center(
            child: Text('hello'),
          ),
        ));
  }
}
Run Code Online (Sandbox Code Playgroud)

注意常量构造函数,

const MyApp({super.key});
Run Code Online (Sandbox Code Playgroud)

我认为卷曲提示 {} 用于可选的命名参数。

我在这里看到没有名字。

这是怎么回事?将 {super.key} 传入常量构造函数意味着什么?

constructor dart flutter

0
推荐指数
1
解决办法
1088
查看次数

标签 统计

.net ×1

c# ×1

constructor ×1

dart ×1

delegates ×1

flutter ×1

function ×1

python ×1

python-3.x ×1

security ×1