Write the syntax of while statement and explain with an


Q1. Draw the flow chart for While loop:

Q2. How many times does the following for loop execute?

for (i = 0; i <= 10; i++)
System.out.println(i * i);

Q3. Write the syntax of while Statement and explain with an example.

Q4. What is Nested loop write an example of nested loops using for loop?

Q5.What is an index? What are the bounds of an array or array list? What is a bounds error?

Q6.What is the output of the following statements?

ArrayList names = newArrayList();
names.add("Bob");
names.add(0, "Ann");
names.remove(1);
names.add("Cal");
names.set(1, "Tony");
for (String s : names)
{
System.out.print(s + ", ");
}

Q7. Write a complete Java program for the following questions: Write a program that print the following on the screen.

Java
Java Java
Java JavaJava
Java JavaJavaJava
Java JavaJavaJavaJava

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write the syntax of while statement and explain with an
Reference No:- TGS01362608

Expected delivery within 24 Hours