এই কোডের সমস্যা কী?

package main;

class Point {
protected int x, y;

public Point(int _x, int _y) {
    x = _x;
    y = _y;
}
}

public class Main {
public static void main(String args[]) {
  Point p = new Point();
  System.out.println("x = " + p.x + ", y = " + p.y);
}    
}

asked 10 Jan, 19:47

rakib%20hossain's gravatar image

rakib hossain
29910

edited 10 Jan, 19:56

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
16618


Main ক্লাসটি যেহেতু পাবলিক তাই একে আলাদা ফাইলে সেভ করতে হবে। ফাইলের নাম ও ক্লাসের নাম একই হতে হবে এবং ফাইলের এক্সটেনশন হবে .java।

permanent link

answered 10 Jan, 20:01

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
16618

edited 10 Jan, 20:02

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×203

question asked: 10 Jan, 19:47

question was seen: 32 times

last updated: 10 Jan, 20:02