# MethodError: no method matching Array(::Type{Int64}, ::Int64) -- New Julia User

**URL:** https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811
**Category:** New to Julia
**Tags:** question, error
**Created:** [August 31, 2020, 1:03am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811 "2020-08-31T01:03:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![W\_K](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@W\_K](https://discourse.julialang.org/u/W_K)
#### Post date: [August 31, 2020, 1:03am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811/1 "2020-08-31T01:03:16Z")

</div>

Hello, I am new here and new to Julia. I can’t figure out how to address this error; I’ve tried the suggestions in similar threads and have been unable to find a solution. Help is appreciated.

```julia

function(form_one)
    println("function was here")
end

function creator(x, y, path_input1, path_input2, formulation, path_to_output)

    ###### MethodError HERE ***************************
    w = Array(Int64, 0)

    c = Array(Int64, 0)

    d = Array(Int64, 0)

# more code follows

end

x=100
y=7
formulation = form_one
#paths defined

creator(x, y, path_input1, path_input2, formulation, path_to_output) 

```

When I run this, I get the following error and stacktrace:

```julia
ERROR: LoadError: MethodError: no method matching Array(::Type{Int64}, ::Int64)
Closest candidates are:
  Array(::LinearAlgebra.UniformScaling, ::Integer, ::Integer) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\LinearAlgebra\src\uniformscaling.jl:395
Stacktrace:
 [1] creator(::Int64, ::Int64, ::String, ::String, ::Function, ::String) at c:\PATH\question.jl:9
 [2] top-level scope at c:\PATH\question.jl:27
 [3] include_string(::Module, ::String, ::String) at .\loading.jl:1064
 [4] (::getfield(Main._vscodeserver, Symbol("##9#12")){String,Int64,Int64,String})() at c:\PATH\julialang.language-julia-0.13.1\scripts\terminalserver\terminalserver.jl:153
 [5] withpath(::getfield(Main._vscodeserver, Symbol("##9#12")){String,Int64,Int64,String}, ::String) at c:\PATH\julialang.language-julia-0.13.1\scripts\terminalserver\repl.jl:62
 [6] (::getfield(Main._vscodeserver, Symbol("##8#11")){String,Int64,Int64,String})() at c:\PATH\julialang.language-julia-0.13.1\scripts\terminalserver\terminalserver.jl:152
 [7] hideprompt(::getfield(Main._vscodeserver, Symbol("##8#11")){String,Int64,Int64,String}) at c:\PATH\julialang.language-julia-0.13.1\scripts\terminalserver\repl.jl:28
 [8] macro expansion at c:\PATH\julialang.language-julia-0.13.1\scripts\terminalserver\terminalserver.jl:148 [inlined]
 [9] (::getfield(Main._vscodeserver, Symbol("##7#10")))() at .\task.jl:268
in expression starting at c:\PATH\question.jl:27

```

I’m very confused why I can’t get this to work – it seems simple but clearly I am missing something. I also tried this in Julia 1.4.2 running on Google Colab, no dice. Thanks for taking a look!

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [August 31, 2020, 1:44am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811/2 "2020-08-31T01:44:51Z")

</div>

Instead of `Array(Int, 0)`, use `Array{Int}(undef, 0)` or `Int[]`

Documentation: [Multi-dimensional Arrays · The Julia Language](https://docs.julialang.org/en/v1/manual/arrays/#Construction-and-Initialization)

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [August 31, 2020, 2:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811/3 "2020-08-31T02:43:56Z")

</div>

> [@W\_K](#):
>
> ```julia
> function(form_one)
> println("function was here")
> end
> 
> ```

By the way, this creates an anonymous function with a single argument called `form_one` instead of a function named `form_one`. To get a function named `form_one`, you need the syntax

```julia
function form_one()
    println("function was here")
end

```

instead.

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [August 31, 2020, 1:51pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811/4 "2020-08-31T13:51:07Z")

</div>

Or `Vector{Int}()`

---

<div class="post-metadata">

### Author: ![W\_K](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@W\_K](https://discourse.julialang.org/u/W_K)
#### Post date: [September 1, 2020, 1:44am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-array-type-int64-int64-new-julia-user/45811/5 "2020-09-01T01:44:46Z")

</div>

Thank you all for your input, I appreciate it.

```julia
Array{Int}(undef, 0)

```

works well for me. Cheers.
