Este documento describe la herencia en programación orientada a objetos. La herencia permite que una clase herede propiedades y métodos de otra clase existente llamada superclase. Las subclases heredan atributos y comportamientos de su superclase y pueden agregar o modificar propiedades. Se explican conceptos como superclase, subclase, jerarquías de herencia, herencia simple y múltiple.
Este documento describe los métodos y técnicas utilizados por los psicólogos industriales. Explica que los psicólogos industriales usan técnicas como la observación, entrevistas, cuestionarios y pruebas psicológicas para seleccionar empleados, mejorar la productividad y satisfacer a los trabajadores. También menciona métodos comúnmente utilizados como la observación natural, el método clínico y las pruebas psicométricas.
El documento describe los conceptos clave relacionados con los roles en grupos. Define roles como patrones de comportamiento esperado para una posición dada en una unidad social. Explica la identidad del rol, percepción del rol, expectativas del rol y conflicto de roles. También menciona brevemente el experimento de la prisión de Stanford de Philip Zimbardo.
Analisis y Diseño de Sistemas II Orientado a objetosGloria Gonzales
El documento describe el lenguaje de modelado UML (Unified Modeling Language). UML es un lenguaje estándar para visualizar, especificar, construir y documentar los componentes de sistemas de software. Proporciona elementos, relaciones y diagramas para modelar la estructura y el comportamiento de sistemas. Algunos diagramas de UML incluyen diagramas de clases, casos de uso, secuencia y componentes.
El documento describe conceptos clave de la programación orientada a objetos como clases, objetos, abstracción, encapsulamiento, asociación y agregación. También menciona diferentes paradigmas de programación e introduce el lenguaje UML para modelar sistemas orientados a objetos.
Java intenta abarcar diferentes dominios como aplicaciones del lado del servidor, del lado del cliente, para teléfonos móviles, programación científica, software de escritorio y más. Permite efectuar trabajos para diferentes aplicaciones gracias a su diseño orientado a objetos y su máquina virtual Java.
El documento describe las clases y objetos en Java. Define una clase CuentaBancaria con variables como número, titular y saldo, y métodos como ingresar y retirar. Explica que una clase define un tipo de dato que puede usarse para declarar objetos, los cuales se crean con la palabra new y reservan memoria dinámica. También cubre temas como acceso a variables de objetos, paso de argumentos, constructores y la variable this.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Este documento describe los métodos y técnicas utilizados por los psicólogos industriales. Explica que los psicólogos industriales usan técnicas como la observación, entrevistas, cuestionarios y pruebas psicológicas para seleccionar empleados, mejorar la productividad y satisfacer a los trabajadores. También menciona métodos comúnmente utilizados como la observación natural, el método clínico y las pruebas psicométricas.
El documento describe los conceptos clave relacionados con los roles en grupos. Define roles como patrones de comportamiento esperado para una posición dada en una unidad social. Explica la identidad del rol, percepción del rol, expectativas del rol y conflicto de roles. También menciona brevemente el experimento de la prisión de Stanford de Philip Zimbardo.
Analisis y Diseño de Sistemas II Orientado a objetosGloria Gonzales
El documento describe el lenguaje de modelado UML (Unified Modeling Language). UML es un lenguaje estándar para visualizar, especificar, construir y documentar los componentes de sistemas de software. Proporciona elementos, relaciones y diagramas para modelar la estructura y el comportamiento de sistemas. Algunos diagramas de UML incluyen diagramas de clases, casos de uso, secuencia y componentes.
El documento describe conceptos clave de la programación orientada a objetos como clases, objetos, abstracción, encapsulamiento, asociación y agregación. También menciona diferentes paradigmas de programación e introduce el lenguaje UML para modelar sistemas orientados a objetos.
Java intenta abarcar diferentes dominios como aplicaciones del lado del servidor, del lado del cliente, para teléfonos móviles, programación científica, software de escritorio y más. Permite efectuar trabajos para diferentes aplicaciones gracias a su diseño orientado a objetos y su máquina virtual Java.
El documento describe las clases y objetos en Java. Define una clase CuentaBancaria con variables como número, titular y saldo, y métodos como ingresar y retirar. Explica que una clase define un tipo de dato que puede usarse para declarar objetos, los cuales se crean con la palabra new y reservan memoria dinámica. También cubre temas como acceso a variables de objetos, paso de argumentos, constructores y la variable this.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Creative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Organizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
PepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contently
This document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert Qian
The document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
The document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
During this webinar, Anand Bagmar demonstrates how AI tools such as ChatGPT can be applied to various stages of the software development life cycle (SDLC) using an eCommerce application case study. Find the on-demand recording and more info at https://applitools.info/b59
Key takeaways:
• Learn how to use ChatGPT to add AI power to your testing and test automation
• Understand the limitations of the technology and where human expertise is crucial
• Gain insight into different AI-based tools
• Adopt AI-based tools to stay relevant and optimize work for developers and testers
* ChatGPT and OpenAI belong to OpenAI, L.L.C.
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Creative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Organizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
PepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contently
This document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert Qian
The document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
The document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
During this webinar, Anand Bagmar demonstrates how AI tools such as ChatGPT can be applied to various stages of the software development life cycle (SDLC) using an eCommerce application case study. Find the on-demand recording and more info at https://applitools.info/b59
Key takeaways:
• Learn how to use ChatGPT to add AI power to your testing and test automation
• Understand the limitations of the technology and where human expertise is crucial
• Gain insight into different AI-based tools
• Adopt AI-based tools to stay relevant and optimize work for developers and testers
* ChatGPT and OpenAI belong to OpenAI, L.L.C.
1. Herencia
Es la derivación de una clase a partir de otra
existente.
El objetivo es la reutilización del software
POO en Java IV: Herencia desarrollado.
(Parte 1)
Franco Guidi Polanco
Escuela de Ingeniería Industrial
Pontificia Universidad Católica de Valparaíso, Chile Herencia
fguidi@ucv.cl
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 2
Súperclases y subclases Súperclases y subclases
La clase de la cual se deriva otra clase se denomina La subclases heredan propiedades de su súperclase.
clase base, súperclase o clase padre. Una subclase, respecto de su súperclase:
Agrega nuevas propiedades
Una clase derivada de una súperclase recibe también Modifica propiedades heredadas.
el nombre de subclase o clase hija.
Patente
Marca
Súperclase -----
Vehículo Clase base Avanza
Clase padre Vehículo
Subclase
Camión Clase derivada Patente
Clase hija Camión Marca
Carga máxima
-----
La herencia aplica en relaciones de naturaleza B es un Avanza
tipo de A Activa tolva
Franco Guidi Polanco 3 Franco Guidi Polanco 4
2. Herencia simple Herencia múltiple
Una clase es subclase de una única súperclase. Una clase es subclase de más de una súperclase.
Vehículos Vehículos
terrestres acuáticos
Vehículo
Vehículos
anfibios
Camión
Java no soporta la herencia múltiple.
Franco Guidi Polanco 5 Franco Guidi Polanco 6
Jerarquías de Herencia Ejemplo (1/2)
La herencia organiza clases bases y derivadas en Determinar si en las siguientes situaciones existe una
jerarquías de clases. relación de herencia entre las clases (indicadas en negrita):
Caso 1 Caso 2 Caso 3
Rut, nombre
Persona
set y get nombre Todo Los Bienes raíces Un Camión tiene
Electrodoméstico se tienen un Rol de Patente. Un Conductor
enciende y apaga. El identificación. Una tiene un camión
Horno microondas Casa tiene también un conducido.
+ Universidad Profesor + Especialidad además abre y cierra su Jefe de hogar y un
Alumno
+ set y get Universidad + set y get Especialidad puerta. Negocio tiene una
Patente comercial
+ Carrera
+ set y get Carrera
Franco Guidi Polanco
Alumno
pregrado
Alumno + Tesis
magíster + set y get Tesis
Profesor + Horas
hora + set y get Horas
7
Electrodoméstico
Horno Microondas
Franco Guidi Polanco
Casa
Bien Raíz
Negocio X 8
3. Ejemplo (2/2) Implementación de jerarquías de herencia
Determinar si en las siguientes situaciones existe una Para crear una subclase a partir de una superclase, en
relación de herencia entre las clases (indicadas en negrita): Java la subclase debe declararse:
Caso 4 Caso 5 Caso 6
Los Archivos Un Avión tiene Una Gaviota vuela.
Multimediales pueden Fuselaje, Alas y Una Abeja vuela y
public class NombreSubclase extends NombreSuperclase
ser Imágenes o Motores. además tiene aguijón.
Música. Las imágenes
pueden ser a Color o
Blanco y Negro. Ejemplo:
X X
Multimedia
Persona
public class Alumno extends Persona
Música Imagen
Color B/N Alumno
Franco Guidi Polanco 9 Franco Guidi Polanco 10
Implementación de jerarquías de herencia:
Implementación de jerarquías de herencia
ejemplo
Implementar las clases Persona y Alumno, de
acuerdo con lo siguiente: public class Persona { public class Alumno extends Persona {
public String rut; public String rolUCV;
Atributos: Operaciones: public String nombre;
Persona - RUT -set y get RUT
public Persona() {
public Alumno() {
rolUCV = 000000-0";
- Nombre - set y get Nombre rut = "00000000-0"; }
nombre = ""; } public void setRolUCV(String r){
public void setRut(String r){ rolUCV = r;
rut = r; } }
Atributos: Operaciones: public String getRut(){ public String getRolUCV(){
Alumno - RUT -set y get RUT return rut; }
public void setNombre(String n){ }
return rolUCV;
- Nombre - set y get Nombre nombre = n; } public String quiénSoy(){
- Rol UCV - set y get Rol UCV public String getNombre(){ return rut + nombre + rolUCV;
return nombre; } }
} }
NOTA: Supondremos, por el momento, todos los
miembros públicos. Súperclase Subclase
Franco Guidi Polanco 11 Franco Guidi Polanco 12
4. Miembros heredados (verdad parcial)
Una subclase hereda de su súperclase (por el
momento):
Variables de instancia públicas
Métodos públicos POO en Java IV: Herencia
(Parte 2)
Todos los anteriores pueden ser utilizados en la
subclase como si hubieran sido declarados en Franco Guidi Polanco
ella . Escuela de Ingeniería Industrial
Pontificia Universidad Católica de Valparaíso, Chile
fguidi@ucv.cl
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 13
Presentación Ejercicio
Hemos visto: Implemente las clases Vehículo, Autobús y
La definición de herencia (y la relación subyacente entre Camión, dados los siguientes antecedentes:
“tipos”) Todo Vehículo tiene patente y marca.
El concepto de súperclase y subclase
Los Autobuses y los Camiones son Vehículos.
La definición de jerarquía de herencia
Todo Autobús tiene cantidad de asientos.
La declaración de una subclase en Java
La extensión de clases que poseen miembros públicos. Todo Camión tiene carga en toneladas.
Veremos:
Un problema de diseño e implementación con herencia,
utilizando miembros públicos.
Se desarrollará una extensión del sistema desarrollado
en el problema.
Franco Guidi Polanco 15 Franco Guidi Polanco 16
5. Análisis Implementación
Jerarquía de clases Vehículo:
public class Vehiculo{
public String patente;
Vehículo Patente, marca public String marca;
public void setPatente(String p){
patente = p;
}
public String setMarca(String m){
marca = m;
Asientos Autobús Camión Carga }
public String getPatente(){
return patente;
}
public String getMarca(){
return marca;
}
}
Franco Guidi Polanco 17 Franco Guidi Polanco 18
Implementación Implementación
Autobús Camión:
public class Autobus extends Vehiculo{ public class Camion extends Vehiculo{
public int asientos; public int carga;
public void setAsientos(int a){ public void setCarga(int c){
asientos = a; carga = c;
} }
public int getAsientos(){ public int getCarga(){
return asientos; return carga;
} }
} }
Franco Guidi Polanco 19 Franco Guidi Polanco 20
6. Uso de las clases desarrolladas Una extensión al problema
Entonces una aplicación podría realizar lo Suponga que se desea agregar al sistema un
siguiente: Camión con compartimientos, el cual posee
public class Ejemplo {
patente, marca, carga máxima y una cantidad de
public static void main( String arg[]){ compartimientos. Este camión es capaz de calcular
…
Autobus bus1 = new Autobus();
la capacidad de carga por compartimiento
bus1.setPatente( “AX1313” ); Métodos heredados (equivalente a la carga total, dividida por la
bus1.setMarca( “Mercedes” ); de Vehículo
bus1.setAsientos( 40 ); cantidad de compartimientos). Además provee un
… método que retorna un String de descripción,
Camion cam1 = new Camion();
cam1.setPatente( “BX1515” ); Métodos heredados compuesto por Marca + Cantidad de
cam1.setMarca( “Iveco” ); de Vehículo
compartimientos
cam1.setCarga( 2000 );
…
}
} ¿Qué se debe hacer?
Franco Guidi Polanco 21 Franco Guidi Polanco 22
Análisis Implementación
El Camión con compartimientos es una Camión con compartimientos:
subclase de Camión. public class CamionCompartimientos extends Camion{
public int compartimientos=1;
Vehículo Patente, marca
public void setCompartimientos(int c){
compartimientos = c;
} carga: es
public int getCompartimientos(){ heredado
return compartimientos; (desde
} Camión)
Asientos Autobús Camión Carga
public int getCargaCompartimiento(){
return carga/compartimientos;
} marca: es
public String getDescripción(){ heredado
return marca + compartimientos;
Compartimientos Camión con }
(desde
Vehículo)
compartimientos }
Franco Guidi Polanco 23 Franco Guidi Polanco 24
7. Uso de la nueva clase
public class Ejemplo2 {
public static void main( String arg[]){
…
CamionCompartimientos cam2 = new CamionCompartimientos(); POO en Java IV: Herencia
cam2.setPatente( “CX1818” );
cam2.setMarca( “Ford” );
Métodos heredados
de Vehículo (Parte 3)
cam2.setCarga( 2500 ); Método heredado de Camión
cam2.setCompartimientos( 5 );
System.out.println( cam2.getCargaCompartimiento() ); Franco Guidi Polanco
System.out.println( cam2.getdescripción() ); Escuela de Ingeniería Industrial
…
Pontificia Universidad Católica de Valparaíso, Chile
} fguidi@ucv.cl
}
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 25
Repaso: extensión de una clase con miembros
Presentación
públicos
Hemos visto:
Los conceptos funamentales asociados a la herencia. public class Persona { public class Alumno extends Persona {
La implementación de subclases en Java, en presencia public String rut; public String rolUCV;
de miembros públicos en la súperclase. public String nombre;
public Alumno() {
Veremos: public Persona() {
rut = "00000000-0"; }
rolUCV = 000000-0";
La implementación de subclases en Java, cuando la nombre = ""; } public void setRolUCV(String r){
public void setRut(String r){ rolUCV = r;
súperclase posee variables de instancia privadas. rut = r; } }
public String getRut(){ public String getRolUCV(){
La relación entre constructores de súperclases y return rut; } return rolUCV;
subclases. public void setNombre(String n){
nombre = n; }
}
public String quiénSoy(){
La relación de las clases con la clase Object. public String getNombre(){
}
return rut + nombre + rolUCV;
return nombre; }
} }
Súperclase Subclase
Franco Guidi Polanco 27 Franco Guidi Polanco 28
8. Miembros heredados (verdad parcial) Miembros no heredados
Una subclase hereda de su súperclase (por el Una subclase no hereda:
momento): Propiedades privadas
Variables de instancia públicas Constructores
Métodos públicos
Los miembros no heredados no pueden aparecer
en el código de la subclase.
Todos los anteriores pueden ser utilizados en la
subclase como si hubieran sido declarados en
ella .
Franco Guidi Polanco 29 Franco Guidi Polanco 30
Miembros no heredados: variables de instancia Miembros no heredados: variables de instancia
privadas privadas
No funciona: Las variables privadas no son heredadas, por lo
public class Persona { public class Alumno extends Persona {
que no pueden aparecer en el código de la
private String rut; private String rolUCV;
subclase.
private String nombre;
public Alumno() {
public Persona() { rolUCV = 000000-0";
rut = "00000000-0"; } Sin embargo se puede hacer uso indirecto de
nombre = ""; }
public void setRut(String r){
public void setRolUCV(String r){
rolUCV = r; ellas en la subclase, a través de los métodos
rut = r; }
public String getRut(){
}
public String getRolUCV(){ públicos de manipulación implementados en la
return rut; }
public void setNombre(String n){ }
return rolUCV;
respectiva súperclase.
nombre = n; } public String quiénSoy(){
public String getNombre(){ return rut + nombre + rolUCV;
return nombre; } }
} }
Error: no pueden ser accesadas directamente
(No compila)
Franco Guidi Polanco 31 Franco Guidi Polanco 32
9. Miembros no heredados: variables de instancia
Miembros no heredados: constructores
privadas
Ejemplo correcto: Los constructores no son heredados, por lo que
public class Persona { public class Alumno extends Persona {
cada subclase debe tener su(s) propio(s)
private String rut; private String rolUCV;
constructor(es).
private String nombre;
public Alumno() { Sin embargo en los constructores se puede invocar
public Persona() {
rut = "00000000-0"; }
rolUCV = 000000-0";
al constructor de la superclase con la instrucción:
nombre = ""; } public void setRolUCV(String r){
public void setRut(String r){ rolUCV = r; }
rut = r; } public String getRolUCV(){
public String getRut(){ return rolUCV; } super( lista parámetros )
return rut; }
public void setNombre(String n){ public String quiénSoy(){
nombre = n; } return getRut() + getNombre()
public String getNombre(){
return nombre; } }
+ rolUCV;
La instrucción super debe ser la primera
} } instrucción del constructor.
Esto sí funciona
Franco Guidi Polanco 33 Franco Guidi Polanco 34
Uso de super en constructores Uso de super en constructores
Ejemplo 1: Ejemplo 2:
public class Persona { public class Alumno extends Persona { public class Persona { public class Alumno extends Persona {
private String rut; private String rolUCV; private String rut; private String rolUCV;
private String nombre; private String nombre;
public Alumno() { public Alumno(String r, String n,
public Persona(String r, String n) { super( 000000-0 , N/A ); public Persona(String r, String n) { String l) {
rut = r; rolUCV = 000000-0"; rut = r; super( r, n );
nombre = n; } nombre = n; rolUCV = l;
} } }
public void setRolUCV(String r){ public void setRolUCV(String r){
public void setRut(String r){ rolUCV = r; } public void setRut(String r){ rolUCV = r;
rut = r; } public String getRolUCV(){ rut = r; } }
public String getRut(){ return rolUCV; } public String getRut(){ public String getRolUCV(){
return rut; } return rut; } return rolUCV;
public void setNombre(String n){ public String quiénSoy(){ public void setNombre(String n){ }
nombre = n; } return getRut() + getNombre() nombre = n; } public String quiénSoy(){
public String getNombre(){ + rolUCV; public String getNombre(){ return getRut() + getNombre()
return nombre; } } return nombre; } + rolUCV;
} } } }
}
Franco Guidi Polanco 35 Franco Guidi Polanco 36
10. Herencia y constructores: la verdad parcial Herencia y constructores
Todo subclase debe incluir una referencia super a algún Dos clases equivalentes:
constructor de la superclase.
public class Alumno extends public class Alumno extends
Persona { Persona {
Si no se incluye la referencia super, Java incluye private String rolUCV; private String rolUCV;
automáticamente una referencia al constructor sin
public Alumno() { public Alumno() {
parámetros de la superclase. Es decir incluye: super(); rolUCV = 000000-0";
super() }
rolUCV = 000000-0"; }
public void setRolUCV(String r){ public void setRolUCV(String r){
Notar que se produce un error cuando no existe un rolUCV = r; }
public String getRolUCV(){
rolUCV = r; }
public String getRolUCV(){
constructor sin parámetros en la superclase y se omite la return rolUCV; } return rolUCV; }
referencia super en la subclase ¿por qué? public String quiénSoy(){ public String quiénSoy(){
return getRut() + getNombre() return getRut() + getNombre()
+ rolUCV; + rolUCV;
} }
} }
Franco Guidi Polanco 37 Franco Guidi Polanco 38
Herencia y constructores: ¡Atención! Herencia y constructores: la verdad total
¿Qué pasa en el siguiente caso? En Java toda clase extiende otra clase.
public class Persona { public class Alumno extends
Las clases que no declaran extender a otras,
Persona { extienden a la clase Object (del package
private String rut;
private String nombre; private String rolUCV; java.lang).
public Persona(String r, String n) {
rut = r;
public Alumno() {
rolUCV = 000000-0";
Object es la superclase (directa o indirecta) de
nombre = n; } todas las clases.
}
public void setRut(String r){
rut = r; } No compila
public void setRolUCV(String r){
rolUCV = r; }
Todas las clases son subclases de Object o de otra
public String getRut(){
Java incluye automáticamente
return rut; }
public String getRolUCV(){
public Alumno() { } subclase.
return rolUCV;
una referencia super(), pero a n){ super();
public void setNombre(String
nombre = n; } public String quiénSoy(){
un constructor inexistente en la rolUCV = 000000-0";
public String getNombre(){
súperclase.nombre; }
return getRut() + getNombre() Por lo tanto: todos los constructores incluyen
return } + rolUCV;
(explícitamente o no) una referencia al constructor de su
}
} } superclase.
Franco Guidi Polanco 39 Franco Guidi Polanco 40
11. Herencia y constructores: la verdad total
Object
Vehículo Persona Bien Raíz POO en Java IV: Herencia
(Parte 4)
Camión Casa Negocio
Alumno Profesor
Franco Guidi Polanco
Escuela de Ingeniería Industrial
Pontificia Universidad Católica de Valparaíso, Chile
fguidi@ucv.cl
Alumno Alumno Profesor
pregrado magíster hora
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 41
Presentación Ejercicio: Implementar las siguientes clases
Hemos visto: Un videojuego tiene Personajes. Cada personaje tiene un nombre
(String) y un nivel propio de energía (int). Además implementan el
Implementación de jerarquías de herencia con variables método alimentarse, que recibe por parámetro una cantidad de energía
de instancia públicas y privadas. (int) con el que incrementa el nivel propio de energía. Los personajes
Invocación de constructores de súperclases mediante pueden ser:
Guerreros: tienen además un arma (String). Al momento de la
super.
instanciación reciben su nombre, arma y nivel propio de energía
La clase Object como la súperclase de toda jerarquía de inicial. Los guerreros tienen un método combatir que recibe por
herencia en Java. parámetro la cantidad de energía a gastar en el ataque, la cual es
descontada de su nivel propio de energía. El método combatir retorna
Veremos: el arma y la cantidad de energía del ataque concatenados.
Un ejercicio de desarrollo de una jerarquía de herencia Magos: tienen además un poder (String). Al momento de la
con variables de instancia privadas, y con referencias instanciación reciben su nombre y poder. Los magos son siempre
creados con un nivel propio de energía igual a 100. Proveen un
explícitas a constructor de la súperclase.
método encantar, que disminuye en 2 unidades el nivel propio de
La representación de clases y jerarquías de herencia energía y que retorna el poder del mago.
mediante diagramas de clases de UML.
Franco Guidi Polanco 43 Franco Guidi Polanco 44
12. Análisis y diseño Análisis y diseño
La clase Personaje:
Personaje
- nombre: String
Nombre de la - energía: int
Personaje clase!
+getNombre(): String
+getEnergia(): int
Visibilidad
+alimentarse(energiaNueva:int)
privada (-)! - nombre: String Variables de +consumirEnergia(gastoEnergia:int)
- energía: int instancia! +Personaje(nombre:String, energia:int)
Visibilidad
pública (+)! +getNombre(): String Métodos y
+getEnergia(): int constructores!
+alimentarse(energiaNueva:int)
+consumirEnergia(gastoEnergia:int) Guerrero Mago
+Personaje(nombre:String, energia:int) -arma: String -poder: String
+combatir(energ:int):String
+encantar():String
+Guerrero(nombre:String, energía:int,
+Mago(nombre:String, poder:String)
arma:String)
Los constructores van subrayados!
Franco Guidi Polanco 45 Franco Guidi Polanco 46
Personaje
Implementación Personaje Implementación
- nombre: String
Clase Personaje: - energía: int
Clase Guerrero:
+getNombre(): String Guerrero
public class Personaje{ +getEnergia(): int
+alimentarse(energiaNueva:int) -arma: String
private String nombre; +consumirEnergia(gastoEnergia:int)
+Personaje(nombre:String, energia:int) +combatir(energ:int):String
private int energia; +Guerrero(nombre:String,
energía:int, arma:String)
public Personaje(String nombre, int energia){ public class Guerrero extends Personaje{
this.nombre = nombre;
private String arma;
this.energia = energia; }
public String getNombre(){ public Guerrero(String nombre, int energia, String arma){
return nombre; } super(nombre, energia);
this.arma = arma;
public int getEnergia(){ }
return energia; } public String combatir(int energ){
public void alimentarse(int energiaNueva){ actualizaEnergia( -1*energ );
energia = energia + energiaNueva; } return arma + energ;
}
public void consumirEnergia(int gastoEnerg){
energia = energia - gastoEnerg; } }
}
Franco Guidi Polanco 47 Franco Guidi Polanco 48
13. Personaje
Implementación Uso de las clases
Clase Mago: Mago Ejemplo:
-poder: String
…
+encantar(energ:int):String
+Mago(nombre:String, poder:String)
public class Mago extends Personaje{ Guerrero g1 = new Guerrero(“Alfa”, 50, “Burbujitas de jabón”);
g1.combatir( 2 );
private String poder; System.out.println( “El nivel de energía de ” + g1.getNombre()
+ “ es ” + g1.getEnergia() );
public Mago(String nombre, String poder){
super(nombre, 100); …
this.poder = poder;
} Mago m1 = new Mago( “Harry”, “Quemar” );
public String encantar(){ m1.encantar();
actualizaEnergia( -2 ); System.out.println( “El nivel de energía de ” + m1.getNombre()
return poder; + “ es ” + m1.getEnergia() );
}
…
}
Franco Guidi Polanco 49 Franco Guidi Polanco 50
Presentación
Hemos visto:
Implementación de jerarquías de herencia con variables de
instancia públicas y privadas e invocación de constructores de
súperclases mediante super.
La clase Object como la súperclase de toda jerarquía de herencia
POO en Java IV: Herencia en Java.
(Parte 5) La notación del Diagrama de Clases de UML para clases y relaciones
de herencia.
Franco Guidi Polanco Veremos:
Tratamiento de variables que referencian subtipos.
Escuela de Ingeniería Industrial
Pontificia Universidad Católica de Valparaíso, Chile Sobreescritura de métodos.
fguidi@ucv.cl Uso del operador instanceof para conocer el tipo de un objeto.
Casting en jerarquías de herencia.
Clases con miembros protegidos (protected).
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 52
14. Referencias, tipos y subtipos Referencias, tipos y subtipos
Una variable de referencia puede Dado que toda clase es subclase directa o indirecta de la
Persona referenciar objetos del mismo tipo de clase Object, una variable de este tipo puede referenciar
la variable (esto ya lo sabíamos). objetos de cualquier tipo. Ejemplos:
Ejemplo:
Object o = new Persona();
Alumno Object o = new Tesista();
Persona p = new Persona();
Object o = new Lavadora();
Tesista Una variable de referencia puede En consecuencia, un arreglo de tipo Object puede
referenciar objetos de cualquier almacenar cualquier tipo de objeto en sus posiciones:
subtipo de la variable. Ejemplos:
Object[] arr = new Object[10];
Persona p = new Alumno(); arr[1] = new Persona();
Persona p = new Tesista(); arr[2] = new Tesista();
arr[3] = new Lavadora();
Franco Guidi Polanco 53 Franco Guidi Polanco 54
Referencias, tipos y subtipos Reconocimiento de clases: operador instanceof
Una variable de referencia de un
Persona determinado tipo NO puede referenciar
El operador instanceof permite reconocer la clase a
objetos de un súpertipo. la que pertenece un objeto referenciado desde una
variable determinada.
Alumno Por lo anterior, las siguientes Formato:
asignaciones NO son válidas: NombreVar instanceof NombreClase
Ejemplo:
Tesista Alumno a = new Persona();
if( pers instanceof Persona )
Tesista t = new Alumno();
System.out.println( La variable pers referencia a una Persona );
Tesista t = new Persona();
else
System.out.println( La variable pers no referencia a una Persona );
Franco Guidi Polanco 55 Franco Guidi Polanco 56
15. Operador instanceof y herencia Operador instanceof: ejemplo
Suponer: Persona p1 =null:
Todo objeto es instancia de la clase a la que
Profesor p2 = new Profesor();
pertenece, como también instancia de su
Alumno p3 = new Alumno();
superclase.
Persona if( p1 instanceof Persona ) --> false!
Electrodoméstico if( p2 instanceof Profesor ) --> true!
Profesor Alumno if( p2 instanceof Persona ) --> true!
Un objeto de la clase lavadora es
if( p2 instanceof Alumno ) --> false!
también un electrodoméstico
Lavadora
if( p3 instanceof Alumno ) --> true!
if( p3 instanceof Persona ) --> true!
if( p3 instanceof Profesor ) --> false!
Franco Guidi Polanco 57 Franco Guidi Polanco 58
Operador instanceof: ejemplo Sobreescritura de métodos
Persona Un método declarado e implementado en una súperclase
puede ser reimplementado en una subclase. Esto se
denomina sobreescritura de métodos.
Alumno Conceptualmente significa que la subclase realiza la misma
Persona personas = new Persona[100];
operación de la súper clase, pero de un modo distinto.
// Supongamos que aquí se ingresan Esto es un caso de polimorfismo.
// al arreglo Personas, Alumnos
// y Tesistas. Tesista public class Persona {
private String rut;
public class Alumno extends
Persona {
…
private String nombre;
public String getRut(){ private String carrera;
//Aquí se muestra la cantidad de tesistas return rut; }
cantidadTesistas = 0; public String getNombre(){ public String identificarse(){
for(int i=0; i< personas.length; i++) return nombre; } return getRut() + getNombre()
public String identificarse(){ + carrera;
if( personas[i] instanceof Tesista ) return rut + nombre; }
cantidadTesistas++; }
System.out.println( “Hay” + cantidadTesistas + “ tesistas”); //otros miembros de la clase… //otros miembros de la clase…
… } }
Franco Guidi Polanco 59 Franco Guidi Polanco 60
16. Sobreescritura de métodos ¿Qué ocurre en las siguientes situaciones?
Consideremos estas clases en los siguientes Persona a = new Persona( 100 , Matías );
System.out.println( a.identificarse() ); 100Matías
ejemplos:
public class Persona { public class Alumno extends 100 Matías public String identificarse(){
Persona { return rut + nombre;
private String rut, nombre; getRut() }
private String carrera;
public Persona(String r, String n){ getNombre()
a
rut = r; public Alumno(String r, String
nombre = n; n, String c){
identificarse()
} super(r,n);
carrera = c;
Alumno b = new Alumno( 100 , Matías , Ind );
public String getRut(){
return rut;
}
System.out.println( b.identificarse() ); 100MatíasInd
} public String identificarse(){
public String getNombre(){ return getRut() + getNombre() public String identificarse(){
return nombre; + carrera; 100 Matías Ind return getRut() +
} } getNombre() +
public String identificarse(){ getRut() carrera;
}
return rut + nombre; }
getNombre()
b
}
}
identificarse()
Franco Guidi Polanco 61 Franco Guidi Polanco 62
¿Qué ocurre en la siguiente situación? Sobreescritura de métodos
public class Persona { public class Alumno extends
Persona a = new Alumno( 100 , Matías , Ind ); private String rut, nombre; Persona {
System.out.println( a.identificarse() ); 100MatíasInd public Persona(String r, String n){
rut = r; nombre = n;
private String carrera;
public Alumno(String r, String
} n, String c){
public String getRut(){ return rut;} super(r,n); carrera = c;
public String identificarse(){ public String getNombre(){ }
100 Matías Ind return getRut() +
return nombre;} public String identificarse(){
public String identificarse(){
public String identificarse(){ return getRut() + getNombre()
return getRut() + getNombre()
getRut() getNombre() + return rut + nombre; + carrera;
+ carrera;
carrera; } }}
getNombre() } } }
a identificarse()
Persona a = new Alumno( 100 , Matías , Ind );
Java resuelve en tiempo de ejecución la asociación entre la System.out.println( a.identificarse() ); 100MatíasInd
variable de referencia y el método que debe invocar, en
función del objeto que se encuentre referenciado en ella.
Franco Guidi Polanco 63 Franco Guidi Polanco 64
17. Sobreescritura de métodos Herencia y acceso a miembros de una clase
public class Persona { public class Alumno extends
Persona a = new Alumno( 100 , Matías , Ind ); private String rut; Persona {
System.out.println( a.identificarse() ); private String nombre;
public setDatos(String r, String n) { private String carrera;
rut = r;
nombre = n; } public String matricularse(
El compilador Java es responsable de verificar que public String getRut(){
return rut; } carrera = c;
String c){
el método pertenezca al tipo de dato declarado por public String getNombre(){
return nombre; }
}
la variable. } }
El intérprete Java es responsable de identificar y
Esto debe funcionar:
ejecutar la implementación del método
correspondiente al tipo de objeto referenciado en Persona a = new Persona();
a.setDatos( “1000-2”, “Luis”);
el momento por la variable.
Alumno b = new Alumno();
b.setDatos( “2000-3”, “Pamela” );
b.matricularse( “Industrial” );
Franco Guidi Polanco 65 Franco Guidi Polanco 66
Herencia y acceso a miembros de una clase Casting
public class Persona { public class Alumno extends public class Persona { public class Alumno extends
private String rut; Persona { private String rut; Persona {
private String nombre; private String nombre;
public setDatos(String r, String n) { private String carrera; public setDatos(String r, String n) { private String carrera;
rut = r; rut = r;
nombre = n; } public String matricularse( nombre = n; } public String matricularse(
public String getRut(){ String c){ public String getRut(){ String c){
return rut; } carrera = c; return rut; } carrera = c;
public String getNombre(){ } public String getNombre(){ }
return nombre; } return nombre; }
} } } }
¿Esto funciona? Error: el compilador
Es necesario introducir un casting para indicar al
determina que este método compilador que el objeto referenciado en la variable es
Persona c = new Alumno(); no pertenece a Persona. Sin efectivamente una instancia de Alumno:
c.setDatos( “1000-2”, “Luis”); embargo la variable contiene
c.matricularse( “Comercial” ); referencia a un Alumno, que es
un tipo de Persona (y que posee Persona c = new Alumno();
este método). c.setDatos( “1000-2”, “Luis”);
( (Alumno)c ).matricularse( “Industrial” );
Franco Guidi Polanco 67 Franco Guidi Polanco 68
18. Casting Miembros protegidos de una clase
El casting no convierte objetos, simplemente El modificador de visibilidad protected, permite
explicita el tipo de objeto referenciado en una declarar visibilidad “protegida” en variables de
variable. instancia y métodos.
Persona a = new Profesor();
Profesor b = a; // ERROR Los miembros de una clase con visibilidad
Persona Persona a = new Profesor(); protegida son sólo accesibles desde la misma clase
Profesor b = (Profesor) a;
Alumno c = (Alumno) a;
// OK
// ERROR
o desde cualquier subclase de ella (no son
accesibles desde otras clases).
Profesor Alumno Persona a = new Persona();
Profesor b = (Profesor) a; // ERROR
Alumno c = (Alumno) a; // ERROR
Alumno a = new Alumno();
Profesor b = (Profesor) a; // ERROR
Franco Guidi Polanco 69 Franco Guidi Polanco 70
Miembros protegidos de una clase Miembros protegidos de una clase
Por lo tanto, una subclase hereda de su Ejemplo:
superclase: public class Persona { public class Alumno extends
Persona {
Variables de instancia protegidas y públicas protected String rut;
protected String nombre; private String rolUCV;
Métodos protegidos y públicos
public Persona(String r, String n) { public Alumno() {
rut = r; super( 000000-0 , N/A );
nombre = n; rolUCV = 000000-0";
} }
public void setRut(String r){
rut = r; } public String quiénSoy(){
public String getRut(){ return rut + nombre
return rut; } + rolUCV;
public void setNombre(String n){ }
nombre = n; } }
public String getNombre(){
return nombre; }
}
Franco Guidi Polanco 71 Franco Guidi Polanco 72
19. Identificación de superclases
Contexto: se está desarrollando
una aplicación que trabaja con
CD’s, DVD’s y discos de vinilo.
Problema: se establece que a
pesar de tener sus propios
POO en Java IV: Herencia atributos, todos ellos disponen de
código, sello discográfico y autor. ProductoMusical
(Parte 6) Se desea evitar duplicidad de
código.
código
sello
autor
Franco Guidi Polanco Decisión: se determina la
conveniencia de crear la clase
Escuela de Ingeniería Industrial “ProductoMusical”, que agrupa las
Pontificia Universidad Católica de Valparaíso, Chile propiedades comunes de los tres
tipos de productos. CD DVD Vinilo
fguidi@ucv.cl
La superclase aparece por factorización
de propiedades comunes
Actualización: 22 de Agosto de 2011
Franco Guidi Polanco 74
Clases abstractas Clases abstractas
En el ejemplo anterior la clase ProductoMusical es abstracta (no Otro ejemplo: un software trabaja con distintas
representa entidades presentes en el dominio).
figuras geométricas, todas ellas polígonos, con
Esta condición se explicita en el diseño, declarando la clase como
abstracta. algunas propiedades en común (ej. cantidad de
lados).
public abstract class ProductoMusical {
ProductoMusical
{abstract} private int código;
código
private String sello;
Polígono
sello ...
autor
}
CD DVD Vinilo
Una clase abstracta no puede ser instanciada, ha sido diseñada sólo
para ser extendida.
Franco Guidi Polanco 75 Franco Guidi Polanco 76
20. Clases abstractas Métodos abstractos
public abstract class Poligono { Supongamos que en el ejemplo
protected int lados; anterior todos los polígonos deben
public void setLados(int l){ proveer un método de cálculo de área.
Polígono lados = l; Polígono
} Conflicto de “fuerzas” en diseño:
... Todos los polígonos deben proveer el
} método, por lo tanto debiese “aparecer” a
nivel de la superclase Polígono.
La operación del método depende de cada
polígono concreto (ej. área de cuagrado:
public class Cuadrado extends Poligono { lado2, área de triángulo base * altura /2,
private int longitud; etc.), por lo tanto no puede establecerse
public void setLongitud(double l) { una lógica común a nivel de superclase.
longitud = l;
} Solución: declarar método como
... abstracto en la superclase.
}
Franco Guidi Polanco 77 Franco Guidi Polanco 78
Métodos abstractos Métodos abstractos
public abstract class Poligono {
Un método abstracto es un método que se declara protected int lados;
en una superclase, pero sin proveer public int setLados(int l){
lados = l;
implementación. }
public abstract double getArea();
La implementación de un método abstracto se Polígono ...
difiere para sus subclases. }
Una clase que declara uno o más métodos
public class Cuadrado extends Poligono {
abstractos es necesariamente abstracta (y debe private double longitud;
ser declarada como tal). public void setLongitud(double l) {
longitud = l;
Si una subclase no provee implementación para un }
public double getArea(){
método abstracto que hereda de su superclase, es return longitud*longitud;
necesariamente abstracta (y debe ser declarada }
...
como tal). } 80
Franco Guidi Polanco 79 Franco Guidi Polanco 80
21. Consecuencias del uso de métodos abstractos
Si una superclase declara algún método
abstracto, entonces:
Las subclases concretas deben implementarlo.
Las variables de referencia declaradas del tipo
de la superclase pueden recibir invocaciones al
método abstracto, sin necesidad de casting.
Ejemplo:
Polígono figura = new Triángulo(); getArea() fue
declarado como
método abstracto
double sup = figura.getArea(); en Polígono.
Franco Guidi Polanco 81