This document provides information on technology evaluation assignments for quality control and testing as well as research and development. It also summarizes a proposed website called "perFect Match" that would match pet needs to products. The website would work by having users enter pet criteria like type, age, weight, and symptoms, then receive a diagnosis and product recommendations to address the pet's needs. The summary proposes the website to Nestle as it would be cost efficient, leverage the company's product recommendation expertise, and make information easily accessible online.
O documento discute espelhos esféricos, especificamente: 1) Apresenta os tipos de espelhos esféricos côncavos e convexos; 2) Explica as leis da reflexão e características dos focos para cada tipo de espelho; 3) Descreve a construção geométrica das imagens formadas por espelhos côncavos e convexos.
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre el gobierno de Putin.
O documento discute o empreendedorismo e as micro e pequenas empresas. Aborda tópicos como o que é empreendedorismo, as características de um empreendedor, os desafios enfrentados por micro e pequenas empresas no Brasil e a importância da inovação.
Micron Technology held an earnings call to discuss its Q3 2012 results. The call included executives Kipp Bedard, Mark Durcan, Ronald Foster, and Mark Adams. Bedard welcomed participants and noted that an audio replay would be available. He highlighted that documents related to the call could be found on Micron's website, including the financial press release and information on upcoming financial conferences. Bedard also provided a safe harbor statement noting that projections made during the call would be forward-looking and that actual results may differ materially from statements made.
This document provides information on technology evaluation assignments for quality control and testing as well as research and development. It also summarizes a proposed website called "perFect Match" that would match pet needs to products. The website would work by having users enter pet criteria like type, age, weight, and symptoms, then receive a diagnosis and product recommendations to address the pet's needs. The summary proposes the website to Nestle as it would be cost efficient, leverage the company's product recommendation expertise, and make information easily accessible online.
O documento discute espelhos esféricos, especificamente: 1) Apresenta os tipos de espelhos esféricos côncavos e convexos; 2) Explica as leis da reflexão e características dos focos para cada tipo de espelho; 3) Descreve a construção geométrica das imagens formadas por espelhos côncavos e convexos.
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre el gobierno de Putin.
O documento discute o empreendedorismo e as micro e pequenas empresas. Aborda tópicos como o que é empreendedorismo, as características de um empreendedor, os desafios enfrentados por micro e pequenas empresas no Brasil e a importância da inovação.
Micron Technology held an earnings call to discuss its Q3 2012 results. The call included executives Kipp Bedard, Mark Durcan, Ronald Foster, and Mark Adams. Bedard welcomed participants and noted that an audio replay would be available. He highlighted that documents related to the call could be found on Micron's website, including the financial press release and information on upcoming financial conferences. Bedard also provided a safe harbor statement noting that projections made during the call would be forward-looking and that actual results may differ materially from statements made.
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.
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
40. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
(3):运算符<<执行一个左移位。移位的结果是:第一个操作数乘以 2 的幂,指数的值
是由第二个数给出的。例如:
1
128 << 1 gives 128*2 = 256
2
<<2 gives 16*2 =64
(4):负数等于正数取反加一。
示例:
注意:
(1)移位运算符将它们右侧的操作数模 32 简化为 int 类型左侧操作数, 模 64 简化为 long
:
类型右侧操作数。因而, 任何 int x, x >>> 32 都会导致不变的 x 值, 而不是你可能预计的
零。
(2):值得称赞的重要一点是: >>>运算符仅被允许用在整数类型, 并且仅对 int 和 long
值有效。 如果用在 short 或 byte 值上, 则在应用>>>之前, 该值将通过带符号的向上类型转
换被升级为一个 int。有鉴于此,无符号移位通常已成为符号移位。
8:用加号(+)进行串链接
运算符 + 能够进行 String 对象的链接并生成一个新的 String:
String salutation = "Dr. ";
String name = "Jack " + "Arthur";
String title = salutation + name;
最后一行的结果是:
Dr. Jack Arthur
如果+运算符中有一个自变量为 String 对象,则其它自变量将被转换成 String。所有
对象都可被自动转换成 String,尽管这样做的结果可能是意义含糊的。不是串的对象是通
过使用 toString() 成员方法而转换成串的等价物的。
9:三目运算 ?:
三目运算符?:表达的是:判断问号前面的条件表达式是否为真,如果为真,返回冒号前
面的值,否则返回冒号后面的值。
例如:
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
41. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
public class Test {
public static void main(String[] args) {
int i = (5>3) ? 6 : 7;
System.out.println("the i="+i);
}
}
运行结果为:the i=6
其实三目运算符的基本功能相当于 if-else(马上就要学到了) ,使用三目运算符是因为
它的表达比相同功能的 if-else 更简洁。上面的例子改成用 if-else 表达如下:
public class Test {
public static void main(String[] args) {
int i = 0;
if (5 > 3) {
i = 6;
} else {
i = 7;
}
System.out.println("the i=" + i);
}
}
运行结果为:the i=6
七:控制语句
1: 分支控制语句
分支语句又称条件语句,条件语句使部分程序可根据某些表达式的值被有选择地执行。
Java 编程语言支持双路 if 和多路 switch 分支语句。
1.1 if , else 语句
if, else 语句的基本句法是:
if (布尔表达式){
语句或块;
} else {
语句或块;
}
例如:
int count;
1.count = getCount(); // a method defined in the program
2.if (count < 0) {
3. System.out.println("Error: count value is negative.");
4.}else {
5. System.out.println("There will be " + count +
6. " people for lunch today.");
7.}
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
42. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
在 Java 编程语言中,if ()用的是一个布尔表达式,而不是数字值,这一点与 C/C++不
同。前面已经讲过,布尔类型和数字类型不能相互转换。因而,如果出现下列情况:
if (x) // x 是 int 型
你应该使用下列语句替代:
if (x ! = 0)
注意:
(1):if 块和 else 块可以包含任意的 java 代码,自然也就可以包含新的 if-else,也就是
说:if-else 是可以嵌套的,嵌套的规则是不可以交叉,必须完全包含。比如:
if(a1 > a2){
if(a1 > a3){
//包含在里面的块必须先结束
}else{
//同样可以包含 if-else 块
}
}
(2):else 部分是选择性的,并且当测试条件为假时如不需做任何事,else 部分可被省略。
也就是说 if 块可以独立存在,但是 else 块不能独立存在,必须要有 if 块才能有 else 块。
(3):如果 if 块和 else 块的语句只有一句时,可以省略{},例如:
if(a1 >a2)
System.out.println(“这是 if 块”);
else
System.out.println(“这是 else 块”);
上面的代码从语法角度是完全正确的,但是从代码的可阅读性上,容易让人产生迷惑,
所以我们不建议大家这么写。
(4):还可以把 else 和 if 组和使用,就是使用 else if,表达“否则如果”的意思,示
例如下:
if(a1 > a2){
System.out.println(“a1 > a2”);
}else if(a1 > a3){
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
43. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
System.out.println(“a1 > a3”);
}else if(a1 > a4){
System.out.println(“a1 > a4”);
}else{
System.out.println(“now is else”);
}
再来个例子:
if (score>=90){
grade= "very good";
}else if(score>=70){
grade= "good";
}else if (score>=60){
grade= "pass";
}else{
grade= "No pass";
}
(5):如果不用“{ }” ,则“else”总是与最接近它的前一个 “if”相匹配
例如:
if ( x > 5 )
if ( y > 5 )
System.out.println( "x and y are > 5" );
else
System.out.println( "x is <= 5" );
执行与上面的对应匹配形式不同,而是与下面形式匹配
if ( x > 5 )
if ( y > 5 )
System.out.println( "x and y are > 5" );
else
System.out.println( "x is <= 5" );
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
44. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
1.2 switch 语句
switch 表示选择分支的情况,switch 语句的句法是:
switch (expr1){
case expr2:
statements;
break;
case expr3:
statements;
break;
default:
statements;
break;
}
说明:
(1) :switch 的表达式 expr1 只能是整数型的值或者 enum 枚举类型的常量值,包含
byte、short、int 和 char,不能是字符串或对象,也不能是 long 型的值。
(2) :当变量或表达式的值不能与任何 case 值相匹配时,可选缺省符(default)指出
了应该执行的程序代码。
例 1:
public class Test {
public static void main(String[] args) {
int colorNum = 5;
switch (colorNum) {
case 0:
System.out.println(Color.red);
break;
case 1:
System.out.println(Color.green);
break;
default:
System.out.println(Color.black);
break;
}
}
}
运行结果:java.awt.Color[r=0,g=0,b=0]
(3) :如果没有 break 语句作为某一个 case 代码段的结束句,则程序的执行将继续到
下一个 case,而不检查 case 表达式的值。
例 2:
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
45. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
public class Test {
public static void main(String[] args) {
int colorNum = 0;
switch (colorNum) {
case 0:
System.out.println(Color.red);
case 1:
System.out.println(Color.green);
default:
System.out.println(Color.black);
break;
}
}
}
运行结果:
java.awt.Color[r=255,g=0,b=0]
java.awt.Color[r=0,g=255,b=0]
java.awt.Color[r=0,g=0,b=0]
例 2 设定背景颜色为黑色,而不考虑 case 变量 colorNum 的值。如果 colorNum 的值为
0,背景颜色将首先被设定为红色,然后为绿色,再为黑色。
2: 循环控制语句
循环语句使语句或块的执行得以重复进行。 Java 编程语言支持三种循环构造类型:for,
while 和 do 循环。for 和 while 循环是在执行循环体之前测试循环条件, do 循环是在执
而
行完循环体之后测试循环条件。这就意味着 for 和 while 循环可能连一次循环体都未执行,
而 do 循环将至少执行一次循环体。
2.1 for 循环
for 循环的句法是:
for (初值表达式; boolean 测试表达式; 改变量表达式){
语句或语句块
}
例如:
for (int i = 0; i < 10; i++) {
System.out.println("Are you finished yet?");
}
System.out.println("Finally!");
注意:for 语句里面的 3 个部分都可以省略,但是我们不建议这么做。
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
46. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
示例如下:
示例 1:就是一个无限循环
public class Test {
public static void main(String[] args) {
for(;;){
System.out.println("Java私塾");
}
}
}
示例 2:可以省略部分
public class Test {
public static void main(String[] args) {
for(int i=0;;){
System.out.println("Java私塾"+i);
}
}
}
示例 3:可以省略部分
public class Test {
public static void main(String[] args) {
for(int i=0;i<3;){
System.out.println("Java私塾"+i);
}
}
}
示例 4:可以省略部分
public class Test {
public static void main(String[] args) {
for(int i=0;;i++){
System.out.println("Java私塾"+i);
}
}
}
当然还有其他的组合方式,都是可以的。
2.2 while 循环
while 循环的句法是:
while (布尔表达式) {
语句或块
}
例如:
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
47. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
int i = 0;
while (i < 10) {
System.out.println("Are you finished yet?");
i++;
};
System.out.println("Finally!");
请确认循环控制变量在循环体被开始执行之前已被正确初始化,并确认循环控制变量是
真时,循环体才开始执行。控制变量必须被正确更新以防止死循环。
2.3 do 循环
do 循环的句法是:
do {
语句或块;
}while (布尔测试);
例如:
int i = 0;
do {
System.out.println("Are you finished yet?");
i++;
} while (i < 10);
System.out.println("Finally!");
象 while 循环一样,请确认循环控制变量在循环体中被正确初始化和测试并被适时更
新。作为一种编程惯例,for 循环一般用在那种循环次数事先可确定的情况,而 while 和 do
用在那种循环次数事先不可确定的情况。
do 循环与 while 循环的不同这处在于,前者至少执行一次,而后者可能一次都不执行。
2.4 特殊循环流程控制
下列语句可被用在更深层次的控制循环语句中:
l break [标注];
l continue[标注];
l label: 语句;//这里必须是任意的合法的语句
break 语句被用来从 switch 语句、循环语句和预先给定了 label 的块中退出,跳出离
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn
48. Java 私塾跟我学系列——JAVA 篇 网址:http://www.javass.cn 电话:010-86835215
break 最近的循环。
continue 语句被用来略过并跳到循环体的结尾,终止本次循环,继续下一次循环。
label 可标识控制需要转换到的任何有效语句,它被用来标识循环构造的复合语句。它
类似以前被人诟病的”goto”语句,我们应该尽量避免使用。
例 1:break 的使用
public class Test {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
if (i == 5) {
break;
}
System.out.println("i==" + i);
}
}
}
运行的结果:i==0 一直到 i==4
因为当 i==5 的时候,执行 break,跳出 for 循环。
例 2:continue 的使用
public class Test {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
if (i == 3) {
continue;
}
System.out.println("i==" + i);
}
}
}
运行的结果:i==0 一直到 i==4,就是不包括 i==3。因为当 i==3 的时候,执行 continue,
终止本次循环,继续下一次循环。
例 3:label 的使用
public class Test {
public static void main(String[] args) {
L: for (int i = 0; i < 5; i++) {
if (i == 3) {
break L;
}
System.out.println("i==" + i);
PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.cn