Report this

What is the reason for this report?

what is Encapsulation?

Posted on February 2, 2026

public class Main { public static void main(String[] args) {

        public class Customer {
            private String id;
            private String name;

            public Customer(String id, String name) {
                this.id = id;
                this.name = name;
            }

            public String Id() { return name; }
            public String Name() { return name; }
            public void Name(String name) { this.name = name; }
        }
}

} and i receive this error: C:\Users\byuka\IdeaProjects\LearningJava\src\Main.java:10 java: illegal character: ‘`’. so how can i correct it and what can focus on during encapsulation.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.