# Getting an Error

**URL:** <https://forum.codewithmosh.com/t/getting-an-error/755>\
**Category:** Java\
**Created:** [November 18, 2020, 9:49pm UTC](https://forum.codewithmosh.com/t/getting-an-error/755 "2020-11-18T21:49:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanseller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/hanseller/32/227_2.png) [@Hanseller](https://forum.codewithmosh.com/u/Hanseller)\
**Post date:** [November 18, 2020, 9:49pm UTC](https://forum.codewithmosh.com/t/getting-an-error/755/1 "2020-11-18T21:49:09Z")

</div>

I was trying the following code on my IntelJ

package com.Global2020;

import java.awt.\*;  
import java.util.Date;

public class Main {

```
public static void main(String[] args) {

```

Point point1 = new Point(x: 1, y: 2);  
Point point2 = point1;  
point1.x = 3;  
point1.y = 5;  
System.out.println(point2);  
}  
}

I have got the following error;

java: ‘)’ expected

* * *

It drives me crazy because, I can not see my mistake. If you please can help me that will be great.

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [November 18, 2020, 10:12pm UTC](https://forum.codewithmosh.com/t/getting-an-error/755/2 "2020-11-18T22:12:16Z")

</div>

Hi and welcome.

Please put code in [code fences](https://forum.codewithmosh.com/t/code-formatting-and-syntax-highlighting/186/3) so it’s properly formatted.

In Java you don’t type the parameter names when calling constructors or methods. So instead of `new Point(x: 1, y: 2);` type `new Point(1, 2);`

---

<div class="post-metadata">

**Author:** ![Hanseller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/hanseller/32/227_2.png) [@Hanseller](https://forum.codewithmosh.com/u/Hanseller)\
**Post date:** [November 18, 2020, 10:20pm UTC](https://forum.codewithmosh.com/t/getting-an-error/755/3 "2020-11-18T22:20:30Z")

</div>

Thank you for your help
