所以我一直在做很多关于为什么这不起作用并且无法找到任何东西的研究。有谁知道这个错误与什么有关?
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `App`.
This error is located at:
in App (created by ExpoRoot)
in ExpoRoot
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
- node_modules\expo\build\logs\LogSerialization.js:160:14 in _captureConsoleStackTrace
- node_modules\expo\build\logs\LogSerialization.js:41:26 in serializeLogDataAsync
- ... 9 more stack frames from framework internals
Run Code Online (Sandbox Code Playgroud)
这是我的App.js: …
我正在练习 Java,我的教授给了我这个问题:
给定一个由 N 个整数(-100 到 100 之间)组成的数组 A,计算数组内所有元素的乘积,并根据输出返回 (-1, 0, 1)。
例如:
A[1,2,3] will return 1 because the output is (6),
A[-1,2,3] will return -1 because the output is (-6),
A[1,2,0] will return 0 because the output is (0)
Run Code Online (Sandbox Code Playgroud)
方法定义:
public static int solution(int[] A) {
}
Run Code Online (Sandbox Code Playgroud)
我的方法:我认为这将是一个递归过程,因为我将有多个输入。
处理一个块 A[1,2,3],将值 (1) 存储到 newArr[] 中,处理另一个块 A[-1,2,3],将值 (-1) 存储到 newArr[] 中,依此类推on... 最后返回 newArr[] 并其中包含正确的值。
到目前为止我所拥有的,现在我有点卡住了..
public static void main(String[] args) {
// TODO Auto-generated method stub
int arr[] = {6,-7,8,9};
int …Run Code Online (Sandbox Code Playgroud)