Assignment – Unit II: Java Programming
Course: Java Programming
Unit: II
Instructions
Answer all questions.
Write your answers in your own words.
Draw diagrams/examples wherever necessary.
Assignment Questions
1. Explain the different conditional control statements in Java. Differentiate between if,
if-else, and if-else-if with suitable examples.
2. What are loops in Java? Explain while, do-while, and for loop with one example each.
3. What is the purpose of break and continue statements? Explain with suitable Java
programs.
4. Define an array. Explain how to declare, initialize, and access one-dimensional arrays
in Java. Also mention the types of arrays.
5. What is a String in Java? Differentiate between mutable and immutable strings.
Explain how to create and use StringBuffer with an example.