{"id":631,"date":"2024-02-25T12:15:47","date_gmt":"2024-02-25T12:15:47","guid":{"rendered":"https:\/\/javigomez.org\/?p=631"},"modified":"2025-09-29T20:33:34","modified_gmt":"2025-09-29T20:33:34","slug":"u08-02-clases-en-java-metodos","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2024\/02\/25\/u08-02-clases-en-java-metodos\/","title":{"rendered":"U08-02-Clases en Java  &#8211; M\u00e9todos"},"content":{"rendered":"\n<p>Los m\u00e9todos en Java son bloques de c\u00f3digo que definen las acciones que un objeto puede realizar.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\npublic class E00_00 {\n\n\tpublic static void main(String&#91;] args) {\n\t\t\n\t\tPersona p=new Persona();\n\t\tp.nombre=\"Javi\";\n\t\tp.edad=56;\n\t\tp.estatura=1.75;\n\t\t\n\t\tSystem.out.println(p.edad);\n\t\t\n\t\tp.cumple();\n\t\t\n\t\tSystem.out.println(p.edad);\n\n\t}\n}\n\nclass Persona{\n\tString nombre;\n\tint edad;\n\tdouble estatura;\n\t\n\tvoid cumple() {\n\t\tthis.edad++;\n\t}\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Java U8 02 Clases Metodos\" width=\"1200\" height=\"900\" src=\"https:\/\/www.youtube.com\/embed\/kuppyTou4Eg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Los m\u00e9todos en Java son bloques de c\u00f3digo que definen las acciones que un objeto puede realizar.<\/p>\n","protected":false},"author":1,"featured_media":632,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[79,203,230,265],"class_list":["post-631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-clases","tag-java","tag-metodos","tag-poo"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/631\/revisions\/893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/632"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}