This document discusses control structures in Java programming. It describes two types of control structures: branching structures and looping structures. Branching structures like if-else and switch statements allow modifying the flow of a program based on certain conditions. Looping structures like while, for, and do-while loops allow repeating blocks of code. Specific looping structures like nested loops, labeled loops, and enhanced for loops are also covered.
Loops execute a block of code a specified number of times, or while a specified condition is true.
Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use loops to perform a task like this.
In PHP, we have the following looping statements:
while - loops through a block of code while a specified condition is true
do...while - loops through a block of code once, and then repeats the loop as long as a specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
Loops execute a block of code a specified number of times, or while a specified condition is true.
Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use loops to perform a task like this.
In PHP, we have the following looping statements:
while - loops through a block of code while a specified condition is true
do...while - loops through a block of code once, and then repeats the loop as long as a specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Materialize CSS - A Material Design FrameworkMRD Official
Materialize CSS is a modern responsive front-end framework based on Material Design. Material Design is a visual language that synthesizes the classic principles of good design with the innovation of technology and science. You can easily use different classes for your website and application like Bootstrap.
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Std 12 computer java basics part 3 control structureNuzhat Memon
Std 12 Computer Chapter 7 Java Basics (Part 3) by Nuzhat Memon
Block in java
Control structures in java
Branches in java
if statement
switch statement
loops in java
for loop
while loop
do while loop
break statement and continue statement
gseb computer paper solution 2020 english medium
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Materialize CSS - A Material Design FrameworkMRD Official
Materialize CSS is a modern responsive front-end framework based on Material Design. Material Design is a visual language that synthesizes the classic principles of good design with the innovation of technology and science. You can easily use different classes for your website and application like Bootstrap.
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Std 12 computer java basics part 3 control structureNuzhat Memon
Std 12 Computer Chapter 7 Java Basics (Part 3) by Nuzhat Memon
Block in java
Control structures in java
Branches in java
if statement
switch statement
loops in java
for loop
while loop
do while loop
break statement and continue statement
gseb computer paper solution 2020 english medium
In this you learn about Control Statements
1. Selection Statements
i. If
ii. If-else
iii. Nested-if
iv. If-Elseif ladder
2. Looping Statements
i. while loop
ii. do-while loop
iii. For loop
3. Jumping Statements
i. break
ii. continue
iii return
C Programming - Decision making, LoopingMURALIDHAR R
Execution of a statement or set of statement repeatedly is called as looping.
The loop may be executed a specified number of times and this depends on the satisfaction of a test condition.
A program loop is made up of two parts one part is known as body of the loop and the other is known as control condition.
Depending on the control condition statement the statements within the loop may be executed repeatedly.
Depending on the position of the control statement in the loop, a control structure may be classified either as an entry controlled loop or as an exit controlled loop.
Entry Controlled Loop:
When the control statement is placed before the body of the loop then such loops are called as entry controlled loops.
If the test condition in the control statement is true then only the body of the loop is executed.
If the test condition in the control statement is not true then the body of the loop will not be executed. If the test condition fails in the first checking itself the body of the loop will never be executed.
Android Application Development - Level 3Isham Rashik
Final level of the Android Application Development series. With this tutorial documentation, this will enable mobile developers to gain complete basic knowledge of Android Development. After completing all 3 of the levels, the developers can proceed with intermediary and advanced concepts.
Explains what is a Set and Dictionary. Explains various operations on Set, Set class methods for manipulation and frozensets. Explains various Dictionary class methods and their usage, use of iterators in Dictionary and use of for loop in dictionary
Explains how to create a List in Python. Explains various operations that can be performed on Lists. Discusses various List class methods that can be used to manipulate the Lists. Explains what is a Tuple how to create it and various function that can be used on Tuples. Explains difference between List and Tuple
Explains various types of branching and looping structures in Python. Explain how to use for loop with sequences and with range() function. Explains how to skip an iteration in a loop. and how to terminate a loop using break statement
What is an Operator? Explains various types of Operators present in Python programming language. Various types of Assignments in Python. Formatting the output in Python.
Teaches what is Data science? Who is Data Scientist? Qualifications required to become a Data Scientist. Responsibilities of Data Scientist. Advantages of Data Science, Roles in Data Science project, Python libraries for Data Science Big Data vs Data Science
Provides information about Threads in Java. different ways of creating and running the thread and also provides the information about Life Cycle of the Thread
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
2. SSBN Degree College, ATP M Vishnuvardhan
Introduction
Program contains a set of instructions . Normally the computer
executes these instructions in the sequence in which they appear, one
by one. This condition is called sequence accomplishment. In order to
modify this flow control structures are used.
A Control structure is structure which is used to modify the flow of the
program.
Control structures are classified in to two types
1.Branching Structures.
2.Looping Structures.
3. SSBN Degree College, ATP M Vishnuvardhan
Branching Structures
Branching structures are take a decision, basing on the
decision it executes a particular block of code only
once.
In java we have
1.2- way branching Structure Eg: if-else
2.Multi-way Branching Eg: switch
4. SSBN Degree College, ATP M Vishnuvardhan
2-Way Branching
If-else is a two-way branching structure in java. Here a
decision is made if it is true then a set of statements are
executed other another set of statements are executed
Flow Chart:-
Test
Condition
True Block False Block
Next
Statement
5. SSBN Degree College, ATP M Vishnuvardhan
Branching Structures
Syntax: if(test condition)
{
//True block
}
else
{
//else block
}
Test condition must always be a relation expression in
java (unlike C where it can be a numeral quantity)
6. SSBN Degree College, ATP M Vishnuvardhan
Various forms of if-else
1. Simple if
2. Nested if
3. Else if ladder
Else-if ladder is also called as multi-way branching
structure.
7. SSBN Degree College, ATP M Vishnuvardhan
Multi Way Branching
Switch is a multi-way branching structure in java.
Unlike if-else a switch statement doesn't have condition
instead it allows a variable to be tested for equality
against a list of values. Each value is called a case, and
the variable being switched on is checked for each case.
9. SSBN Degree College, ATP M Vishnuvardhan
Multi Way Branching
Syntax:
switch(expr)
{
case value1: block1 break;
case value2: block2 break;
case value n: blockn break;
default: default block1 break;
}
next statement;
expr must always yield integer/ char quantity only
from jdk1.5.0 Strings are also supported in switch
10. SSBN Degree College, ATP M Vishnuvardhan
Rules for switch
1. The variable used in a switch statement can only be integers, convertible
integers (byte, short, char), strings and enums.
2. You can have any number of case statements within a switch. Each case is
followed by the value to be compared to and a colon.
3. The value for a case must be the same data type as the variable in the
switch and it must be a constant or a literal.
4. When the variable being switched on is equal to a case, the statements
following that case will execute until a break statement is reached.
5. When a break statement is reached, the switch terminates, and the flow of
control jumps to the next line following the switch statement.
6. Not every case needs to contain a break. If no break appears, the flow of
control will fall through to subsequent cases until a break is reached.
7. A switch statement can have an optional default case, which must appear
at the end of the switch. The default case can be used for performing a
task when none of the cases is true. No break is needed in the default case.
11. SSBN Degree College, ATP M Vishnuvardhan
Looping Structures
There may be a situation when you need to execute a block of
code several number of times. A loop statement allows us to
execute a statement or group of statements multiple times.
Looping Structures are classified in to two types
1.Entry Control loop
Here test condition is checked before entering the loop body
Eg:- while, for
1.Exit Control loop
Here test condition is checked after executing the loop body
Eg:- do-while
12. SSBN Degree College, ATP M Vishnuvardhan
Entry Control vs Exit Control
Body of Loop
Condition
Next Statement
True
False
Body of Loop
Condition
Next Statement
False
True
13. SSBN Degree College, ATP M Vishnuvardhan
Looping Structures
When writing looping structures programmer should take really
care because they may tend to infinite loops.
The following points to be remembered while writing loops
1.Create and initialize a loop control variable
2.Form a condition using the loop control variable
3.Increment or decrement the loop control variable
14. SSBN Degree College, ATP M Vishnuvardhan
While Loop
Syntax:
while(textCondition)
{
=====
===== //body of loop
=====
}
Eg: int c=1;
while(c<=5)
{
System.out.println(“Java “);
c=c+1;
}
15. SSBN Degree College, ATP M Vishnuvardhan
for Loop
Syntax:
for(initialization; condition; increment)
{
=====
===== //body of loop
=====
}
Eg: for(int c=1;c<=5;c++)
{
System.out.println(“Java “);
}
16. SSBN Degree College, ATP M Vishnuvardhan
Nested for loops
If a for loop is placed inside another for loop then it s called as nested
for loops
Eg:
for(int i = 1; i <= 5; ++i)
{
for(int j = 1; j <= 5; ++j)
{
System.out.print(“Java”);
}
System.out.println(“Program");
}
For every iteration of outter for loop the inner for loop runs m times
i.e., for n iterations of outer loop inner loops works for nxm times
17. SSBN Degree College, ATP M Vishnuvardhan
Labelled loops
Java allows to keep labels for the loops. A label is a valid identifier
follwed by colon. Labelled loops are used for exiting multiple loops at
once with the help of break or continue
Syntax labelName:
Eg:
outter:
for(int i = 1; i <= 5; ++i)
{
inner:
for(int j = 1; j <= 5; ++j)
{
System.out.print(“Java”);
}
System.out.println(“Program");
}
18. SSBN Degree College, ATP M Vishnuvardhan
Enhanced for Loop (for each loop)
Enhanced for loop is generally used to process arrays collections.
It is introduced in JDK 1.5.0
Features:
It starts with the keyword for like a normal for-loop.
Instead of declaring and initializing a loop counter variable,
you declare a variable that is the same type as the base type of
the array, followed by a colon, which is then followed by the
array name.
In the loop body, you can use the loop variable you created
rather than using an indexed array element.
It’s commonly used to iterate over an array or a Collections
class (eg, ArrayList)
19. SSBN Degree College, ATP M Vishnuvardhan
Enhanced for Loop (for each loop)
Syntax:
for(datatype var : arrayName)
{
=====
===== //body of loop
=====
}
Eg: int a[]={10,20,30,40,50};
for(int element : a)
{
System.out.println(element);
}
int a[]={10,20,30,40,50};
for(int i=0;i<5;i++))
{
System.out.println(a[i]);
}
(OR)
20. SSBN Degree College, ATP M Vishnuvardhan
Do While Loop
Syntax:
do
{
=====
===== //body of loop
=====
} while(textCondition);
Eg: int c=1;
do
{
System.out.println(“Java “);
c=c+1;
} while(c<=5);
21. SSBN Degree College, ATP M Vishnuvardhan
Control Statements
Java provides 3 control statements
1. break 2. continue 3. return
Break statement is generally used to break loop or switch
statement. It breaks the current flow of the program at specified
condition. In case of nested loops it breaks only the loop in which
it is placed.
Syntax : break; public class BreakExample
{
public static void main(String[] args)
{
for(int i=1;i<=10;i++)
{
if(i==5)
break;
System.out.println(i);
}
}
}
22. SSBN Degree College, ATP M Vishnuvardhan
Control Statements
public class BreakExample2
{
public static void main(String[] args)
{
for(int i=1;i<=3;i++){
for(int j=1;j<=3;j++){
if(i==2&&j==2){
break;
}
System.out.println(i+" "+j);
}
}
}