{"id":12726,"date":"2015-02-18T21:53:11","date_gmt":"2015-02-19T02:53:11","guid":{"rendered":"https:\/\/panamahitek.com\/que-son-las-clases-en-java\/"},"modified":"2021-03-11T23:08:13","modified_gmt":"2021-03-12T04:08:13","slug":"what-are-classes-in-java","status":"publish","type":"post","link":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/","title":{"rendered":"What are Classes in Java?"},"content":{"rendered":"<p style=\"text-align: justify;\">Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming, which is one of the main software development paradigms today.<\/p>\n<p style=\"text-align: justify;\">If we look for <a href=\"https:\/\/es.wikipedia.org\/wiki\/Java_(lenguaje_de_programaci%C3%B3n)\">Java in Wikipedia<\/a>, in the definition that is available for the programming language with this name we will find:<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Java is a general-purpose, concurrent, object-oriented programming language that was specifically designed to have as few implementation dependencies as possible.<\/p>\n<\/blockquote>\n<p>There is something that stands out from this short definition: object-oriented. What does it mean?<\/p>\n<p>According to Wikipedia:<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Object Oriented Programming or OOP (OOP) is a programming paradigm that uses objects in their interactions to design applications and computer programs. It is based on various techniques, including inheritance, cohesion, abstraction, polymorphism, coupling, and encapsulation. Its use became popular in the early 1990s. Today, there is a wide variety of programming languages that support object orientation.<\/p>\n<\/blockquote>\n<p style=\"text-align: justify;\">I am going to define them in a simpler way: it is the best programming paradigm created by man. It allows you to write code in an orderly way, reuse it, order the information and do a thousand and one tasks that without this paradigm would be unthinkable. Almost all current programming languages have this kind of paradigm, but in my opinion, Java is synonymous with object-oriented language. It is one of its main characteristics.<\/p>\n<p style=\"text-align: justify;\">What I will try to do now is explain what a class is while giving you some tips when programming in Java. We have to be educated in the way we program and keep an order in what we do.<\/p>\n<p style=\"text-align: justify;\"><!--more--><\/p>\n<h5 style=\"text-align: justify;\"><strong>What is a class?<\/strong><\/h5>\n<h6 style=\"text-align: justify;\">Classes in Java are basically a template used to create an object. If we imagine classes in the world we live in, we could say that the class &#8220;person&#8221; is a template for how a human being should be. Each and every one of us human beings are objects of the class &#8220;person&#8221;, since we are all persons. The class &#8220;person&#8221; contains the definition of a human being, while each human being is an instance or object of that class.<\/h6>\n<p style=\"text-align: justify;\">In order to understand this we must see it with examples. We are going to create a project in Netbeans that I am going to call <strong>JavaExamples<\/strong>.<\/p>\n<p><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7667 size-full\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.png\" alt=\"Classes in Java\" width=\"744\" height=\"291\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.png 744w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java-300x117.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">We see that a file named <strong>JavaExamples.java<\/strong> (Java File Class) is created. This is the main class, the one that contains the <strong>public static void main<\/strong> method. When running a program, whatever is set in the <strong>void main<\/strong> will be the first thing to run. The <strong>JavaExamples<\/strong> class is an example of a class, but it is not clear what concepts I would like to convey to you, so we are going to create a class that we will call &#8220;<strong>persona<\/strong>&#8220;.<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12727\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java1.png\" alt=\"Classes in Java\" width=\"652\" height=\"255\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java1.png 744w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java1-300x117.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a><\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-large wp-image-7669 aligncenter\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java2.png\" alt=\"clases en Java\" width=\"648\" height=\"253\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java2.png 744w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java2-300x117.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Now we are going to start building the class &#8220;person&#8221;. We need to set the <strong>properties of the persona class<\/strong>. As people, what properties do we have?<\/p>\n<p style=\"text-align: justify;\">We could talk about a <span style=\"text-decoration: underline;\">name<\/span>, <span style=\"text-decoration: underline;\">surname<\/span>, <span style=\"text-decoration: underline;\">a date we were born<\/span>, our <span style=\"text-decoration: underline;\">age<\/span> and <span style=\"text-decoration: underline;\">gender<\/span>. There are many other properties that we could mention, but for now we will only take into account the ones that we have listed. They are simply characteristics that every human being possesses, at least in most cases.<\/p>\n<p style=\"text-align: justify;\">To establish these properties within the class we create variables, taking care to assign each property the type of data that corresponds to it. That said, we declare the properties of the <strong>persona class<\/strong>:<\/p>\n<pre class=\"lang:default decode:true \">private String name;\r\n    private String lastName;\r\n    private String birthDate;\r\n    private int age;\r\n    private String gender;<\/pre>\n<p style=\"text-align: justify;\">By setting the properties as <strong>private<\/strong> we are ensuring that within the person class these properties can be accessed and manipulated, but not from another class, unless the user so decides and it is carried out through <strong>public methods<\/strong>. We will see this a little later.<\/p>\n<p style=\"text-align: justify;\">Once the properties of the class are established, we create a <strong>constructor<\/strong>. The constructor is a method with the same name as the class itself, where the parameters and actions to be executed are established whenever a new object or instance is created (object and instance are basically the same). In Java the so-called &#8220;functions&#8221; of other languages are known as &#8220;<strong>methods<\/strong>&#8220;. Our constructor would be:<\/p>\n<pre class=\"lang:default decode:true\"> public persona(String nombre, String apellido, String fecha, int edad, String genero) {\r\n        name = nombre;\r\n        lastName = apellido;\r\n        birthDate = fecha;\r\n        age = edad;\r\n        gender = genero;\r\n    }<\/pre>\n<p style=\"text-align: justify;\">When we are going to build an object of the class person, we will be forced to establish a series of initial parameters. When the instance is created, the first task the class will perform is to assign the constructor parameters to the class properties. These properties, as we already mentioned, have private access within the class and cannot be modified from the outside. However, we can grant you restricted access from outer classes to the properties of our &#8220;person&#8221; class. For this we establish the so-called <strong>getters<\/strong> and <strong>setters<\/strong> that are methods to obtain or modify properties of a class.<\/p>\n<p>An example would be the setter and getter for the Name property.<\/p>\n<pre class=\"lang:default decode:true \">  public void setName(String nombre) {\r\n        name = nombre;\r\n    }\r\n\r\n    public String getName() {\r\n        return name;\r\n    }<\/pre>\n<p style=\"text-align: justify;\">When we invoke the <em>setter<\/em> <strong>setName<\/strong>(String nombre) we are changing the name property for the parameter that we introduce, that is, nombre (name in Spanish). This method is of type <strong>void<\/strong>, so it does not return any value. Just change the name property and nothing else.<\/p>\n<p style=\"text-align: justify;\">When we invoke the getter <strong>getName()<\/strong> we will &#8220;call&#8221; the name property and obtain its value. The method is type String, so it returns a string of characters with the value of the name property, hence the return name command is used.<\/p>\n<p style=\"text-align: justify;\">Now we set the <strong><em>getters<\/em> <\/strong>and <strong><em>setters<\/em> <\/strong>for all the properties. Our person class would look like this:<\/p>\n<pre class=\"lang:default decode:true \">public class persona {\r\n\r\n    \/\/Propiedades\r\n    private String name;\r\n    private String lastName;\r\n    private String birthDate;\r\n    private int age;\r\n    private String gender;\r\n\r\n    \/\/Constructor\r\n    public persona(String nombre, String apellido, String fecha, int edad, String genero) {\r\n        name = nombre;\r\n        lastName = apellido;\r\n        birthDate = fecha;\r\n        age = edad;\r\n        gender = genero;\r\n    }\r\n    \r\n    \/\/M\u00e9todos - getters&amp;setters\r\n\r\n    public void setName(String nombre) {\r\n        name = nombre;\r\n    }\r\n\r\n    public String getName() {\r\n        return name;\r\n    }\r\n\r\n    public void setLastName(String apellido) {\r\n        lastName = apellido;\r\n    }\r\n\r\n    public String getLastName() {\r\n        return lastName;\r\n    }\r\n\r\n    public void setBirthDate(String fecha) {\r\n        birthDate = fecha;\r\n    }\r\n\r\n    public String getBirthDate() {\r\n        return birthDate;\r\n    }\r\n\r\n    public void setAge(int edad) {\r\n        age = edad;\r\n    }\r\n\r\n    public int getAge() {\r\n        return age;\r\n    }\r\n\r\n    public void setGender(String genero) {\r\n        gender = genero;\r\n    }\r\n\r\n    public String getGender() {\r\n        return gender;\r\n    }\r\n\r\n}\r\n<\/pre>\n<p>So the internal structure of our &#8220;person&#8221; class should look like this:<\/p>\n<figure id=\"attachment_7671\" aria-describedby=\"caption-attachment-7671\" style=\"width: 745px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7671\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java3-1024x540.png\" alt=\"Classes in Java\" width=\"745\" height=\"393\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java3-1024x540.png 1024w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java3-300x158.png 300w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java3.png 1000w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/a><figcaption id=\"caption-attachment-7671\" class=\"wp-caption-text\">Class properties (blue), class constructor (yellow) and class getters and setters (green)<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Our &#8220;people&#8221; class is ready. We have created a template to &#8220;create&#8221; people. But how can we accomplish this? We go to our main class and create an instance of the person class.<\/p>\n<pre class=\"lang:default decode:true\">persona p1 = new persona(\"Antony\", \"Garc\u00eda Gonz\u00e1lez\", \"30\/7\/1992\", 22, \"M\");<\/pre>\n<p style=\"text-align: justify;\">This new person that I have created with the name of p1 has a name &#8220;Antony&#8221;, surnames &#8220;Garc\u00eda Gonz\u00e1lez&#8221;, date of birth &#8220;7\/30\/1992&#8221;, age 22 and is male.<\/p>\n<p style=\"text-align: justify;\">The object p1 represents me. I am Antony Garc\u00eda Gonz\u00e1lez, but within Java I am an object named p1. We create this object following the following syntax:<\/p>\n<p style=\"text-align: center;\"><strong>Class_name<\/strong> object_name = new <strong>Class_name<\/strong>(constructor parameters).<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7673\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java5.png\" alt=\"clases en Java\" width=\"758\" height=\"413\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java5.png 758w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java5-300x163.png 300w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java5-750x410.png 750w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Classes in Java are always instantiated in the same way. To instantiate is to create an object of a class. So this object that we created, within our application is called p1 but for the software user it has my name, Antony.<\/p>\n<p style=\"text-align: justify;\">From the object p1 we can &#8220;obtain&#8221; its properties or &#8220;modify&#8221; them. If we write in our code in the Netbeans IDE &#8220;p1.&#8221; The following will appear:<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java4.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7672 aligncenter\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java4.png\" alt=\"clases en Java\" width=\"424\" height=\"347\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java4.png 424w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java4-300x246.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">We see that the Netbeans wizard presents us with all the methods available for the p1 object. That is the advantage of classes in Java, that a single object contains a large number of methods inside it to carry out different procedures summarized in a single line of code. For now we have worked with short sentences, just setting properties or getting their values. But we could well add a method that does something much more complicated and extensive and invoke it after having created an object of the class in question.<\/p>\n<p style=\"text-align: justify;\">There are some methods that we did not set, such as <span style=\"text-decoration: underline;\">equals<\/span>, <span style=\"text-decoration: underline;\">hashCode<\/span>, etc &#8230; These are methods inherited from the Object class. We will study the concept of inheritance in other contributions. For now, it is enough to know that we have at our disposal the getters and setters that we established when building our &#8220;persona&#8221; class.<\/p>\n<p style=\"text-align: justify;\">We can build as many objects as we want.<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java6.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7674 aligncenter\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java6.png\" alt=\"clases en Java\" width=\"758\" height=\"306\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java6.png 758w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java6-300x121.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">We can suddenly change some name of some object.<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java7.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7675 aligncenter\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java7.png\" alt=\"clases en Java\" width=\"758\" height=\"413\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java7.png 758w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java7-300x163.png 300w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java7-750x410.png 750w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">We can test the getters by printing the information from the<strong> p2<\/strong> object to the console.<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java8.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-large wp-image-7676 aligncenter\" src=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java8-1024x549.png\" alt=\"clases en Java\" width=\"648\" height=\"347\" srcset=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java8-1024x549.png 1024w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java8-300x161.png 300w, https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java8.png 1136w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">By using getters, we simply get character strings with the values of the properties of the set. We print these strings to the console with System.out.println and at the bottom of the window we see the results. In the first impression the name and other properties are those that we established in the creation of the object p2. Then with the setters we change some properties and when we print again we see that the information has changed.<\/p>\n<p style=\"text-align: justify;\">I hope the concept of classes in Java, their construction and the creation of objects has been clear. In the next few days I will be posting a little more about the thousand and one things we can achieve with object-oriented programming. See ya&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming, which is one of the main software development paradigms today. If we look for Java in Wikipedia, in the definition that is available for the programming language with this name we will find: Java is a general-purpose, concurrent, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12728,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2008,1984],"tags":[2013,1976,2001,2011,2012,2009,2010,2014],"class_list":{"0":"post-12726","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-java-tutorials","8":"category-programming","9":"tag-classes-in-java","10":"tag-java-en","11":"tag-java-class-en","12":"tag-java-for-beginners","13":"tag-java-programming","14":"tag-java-tutorials","15":"tag-learning-java","16":"tag-object-oriented-programming"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are Classes in Java? - Panama Hitek<\/title>\n<meta name=\"description\" content=\"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are Classes in Java? - Panama Hitek\" \/>\n<meta property=\"og:description\" content=\"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming\" \/>\n<meta property=\"og:url\" content=\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"Panama Hitek\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/antony.garcia.gonzalez\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-19T02:53:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-12T04:08:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1026\" \/>\n\t<meta property=\"og:image:height\" content=\"613\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Antony Garc\u00eda Gonz\u00e1lez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/antony_garcia_g\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antony Garc\u00eda Gonz\u00e1lez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\"},\"author\":{\"name\":\"Antony Garc\u00eda Gonz\u00e1lez\",\"@id\":\"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e\"},\"headline\":\"What are Classes in Java?\",\"datePublished\":\"2015-02-19T02:53:11+00:00\",\"dateModified\":\"2021-03-12T04:08:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\"},\"wordCount\":1411,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg\",\"keywords\":[\"classes in java\",\"Java\",\"java class\",\"java for beginners\",\"java programming\",\"java tutorials\",\"learning java\",\"Object Oriented Programming\"],\"articleSection\":[\"Java tutorials\",\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\",\"url\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\",\"name\":\"What are Classes in Java? - Panama Hitek\",\"isPartOf\":{\"@id\":\"https:\/\/panamahitek.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg\",\"datePublished\":\"2015-02-19T02:53:11+00:00\",\"dateModified\":\"2021-03-12T04:08:13+00:00\",\"author\":{\"@id\":\"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e\"},\"description\":\"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming\",\"breadcrumb\":{\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage\",\"url\":\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg\",\"contentUrl\":\"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg\",\"width\":1026,\"height\":613},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/panamahitek.com\/en\/home\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What are Classes in Java?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/panamahitek.com\/en\/#website\",\"url\":\"https:\/\/panamahitek.com\/en\/\",\"name\":\"Panama Hitek\",\"description\":\"Conocimiento libre, de Panam\u00e1 para el mundo\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e\",\"name\":\"Antony Garc\u00eda Gonz\u00e1lez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/panamahitek.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d7a10397454e66de561db7fc2ed37dd2bd115478c378b22eaafd410de973dfd1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d7a10397454e66de561db7fc2ed37dd2bd115478c378b22eaafd410de973dfd1?s=96&d=mm&r=g\",\"caption\":\"Antony Garc\u00eda Gonz\u00e1lez\"},\"description\":\"Ingeniero Electromec\u00e1nico, egresado de la Universidad Tecnol\u00f3gica de Panam\u00e1. Miembro fundador de Panama Hitek. Entusiasta de la electr\u00f3nica y la programaci\u00f3n.\",\"sameAs\":[\"https:\/\/www.facebook.com\/antony.garcia.gonzalez\",\"https:\/\/www.instagram.com\/antony.garcia.gonzalez\",\"https:\/\/www.linkedin.com\/in\/antony-garcia-gonzalez-96539461\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/antony_garcia_g\"],\"url\":\"https:\/\/panamahitek.com\/en\/author\/agarciag-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are Classes in Java? - Panama Hitek","description":"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/","og_locale":"en_US","og_type":"article","og_title":"What are Classes in Java? - Panama Hitek","og_description":"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming","og_url":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/","og_site_name":"Panama Hitek","article_author":"https:\/\/www.facebook.com\/antony.garcia.gonzalez","article_published_time":"2015-02-19T02:53:11+00:00","article_modified_time":"2021-03-12T04:08:13+00:00","og_image":[{"width":1026,"height":613,"url":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","type":"image\/jpeg"}],"author":"Antony Garc\u00eda Gonz\u00e1lez","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/antony_garcia_g","twitter_misc":{"Written by":"Antony Garc\u00eda Gonz\u00e1lez","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#article","isPartOf":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/"},"author":{"name":"Antony Garc\u00eda Gonz\u00e1lez","@id":"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e"},"headline":"What are Classes in Java?","datePublished":"2015-02-19T02:53:11+00:00","dateModified":"2021-03-12T04:08:13+00:00","mainEntityOfPage":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/"},"wordCount":1411,"commentCount":0,"image":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","keywords":["classes in java","Java","java class","java for beginners","java programming","java tutorials","learning java","Object Oriented Programming"],"articleSection":["Java tutorials","Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/","url":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/","name":"What are Classes in Java? - Panama Hitek","isPartOf":{"@id":"https:\/\/panamahitek.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage"},"image":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","datePublished":"2015-02-19T02:53:11+00:00","dateModified":"2021-03-12T04:08:13+00:00","author":{"@id":"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e"},"description":"Classes in Java (Java Class) are templates for creating objects, in what is known as object-oriented programming","breadcrumb":{"@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#primaryimage","url":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","contentUrl":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","width":1026,"height":613},{"@type":"BreadcrumbList","@id":"https:\/\/panamahitek.com\/en\/what-are-classes-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/panamahitek.com\/en\/home\/"},{"@type":"ListItem","position":2,"name":"What are Classes in Java?"}]},{"@type":"WebSite","@id":"https:\/\/panamahitek.com\/en\/#website","url":"https:\/\/panamahitek.com\/en\/","name":"Panama Hitek","description":"Conocimiento libre, de Panam\u00e1 para el mundo","inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/panamahitek.com\/en\/#\/schema\/person\/a22e06c60a9a3fad2dcddfb25a6fca6e","name":"Antony Garc\u00eda Gonz\u00e1lez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/panamahitek.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d7a10397454e66de561db7fc2ed37dd2bd115478c378b22eaafd410de973dfd1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d7a10397454e66de561db7fc2ed37dd2bd115478c378b22eaafd410de973dfd1?s=96&d=mm&r=g","caption":"Antony Garc\u00eda Gonz\u00e1lez"},"description":"Ingeniero Electromec\u00e1nico, egresado de la Universidad Tecnol\u00f3gica de Panam\u00e1. Miembro fundador de Panama Hitek. Entusiasta de la electr\u00f3nica y la programaci\u00f3n.","sameAs":["https:\/\/www.facebook.com\/antony.garcia.gonzalez","https:\/\/www.instagram.com\/antony.garcia.gonzalez","https:\/\/www.linkedin.com\/in\/antony-garcia-gonzalez-96539461\/","https:\/\/x.com\/https:\/\/twitter.com\/antony_garcia_g"],"url":"https:\/\/panamahitek.com\/en\/author\/agarciag-2\/"}]}},"jetpack_featured_media_url":"https:\/\/panamahitek.com\/wp-content\/uploads\/2015\/02\/clases-en-Java.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/posts\/12726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/comments?post=12726"}],"version-history":[{"count":0,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/posts\/12726\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/media\/12728"}],"wp:attachment":[{"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/media?parent=12726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/categories?post=12726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/panamahitek.com\/en\/wp-json\/wp\/v2\/tags?post=12726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}