What statements are used in jumping statements of java

Assignment Help JAVA Programming
Reference no: EM132030996

JAVA - CONTROL STATEMENTS

1. Java Control statements the order of execution in a java program, based on data values and conditional logic

A. manages        B. control
C. manipulate     D. view

2. In Java, what are the categories of control statements are available?
A. Selection Statement        B. Iteration Statement
C. Jumping Statement          D. All the above

3. Which of the following are Selection Statements?
A. if and if...else statement    B. switch Statement
C. for Statement                  D. both A and B

4. What is the output of the program?
class Example
{
public static void main(String args[ ])
{
int month = 4; String season;
if(month == 12 || month == 1 || month == 2) season = "Winter";
else if(month == 3 || month == 4 || month == 5) season = "Spring";
else if(month == 9 || month == 10 || month == 11) season = "Autumn";
else
season = "Bogus Month"; System.out.println("April is in the " + season + ".");
}
}
A. April is in the Winter season.
B. April is in the Spring season.
C. April is in the Autumn season.
D. Bogus Month

5. Which statement is called as multiple branch statement in Java?
A. switch statement      B. while statement
C. if...else statement     D. None of the above

6. What is the output of the program? public class Demo
{
public static void main(String[] args)
{
for (int count = 1; count <= 10; count++)
{
System.out.print(count); System.out.print(" ");

}
}
}
A. 1 2 3 4 5 6 7 8 9 10       B. 12345678910
C. 1 2 3 4 5 6 7 8 9 10       D. Compiler error

7. Which looping statement is used for array of values?

A. for loop                      B. for each loop
C. while loop                   D. None of the above

8. What statements are used in jumping statements of Java?
A. break              B. return
C. continue          D. all of the above

9. What is the output for this program? public class BLoop {
public static void main(String args[]) { for(int i=0; i<10; i++)
{
System.out.print(" " + i); break;
}
System.out.print("\nLoop Completed");
}
}
A. 0                       B. 0 1 2 3 4 5 6 7 8 9 10
C. Loop Completed    D. Both A and C

10. What is the output for this program? [Level:Medium]
public class RExample{
public static void main(String args[]){ int n=5;
if(n==5)
System.out.println("Before RETURN statement"); return;
System.out.println("After RETURN statement");
}
}
A. Before RETURN statement       B. After RETURN statement
C. unreachable code                  D. Both A and B

Reference no: EM132030996

Questions Cloud

Currency instead of adopting the euro : Both revised sentences are correct.Britain joined the European Union, yet it retained its own currency instead of adopting the euro.
What are the essential characteristics of participants : Reflect on your research problem and question. What are the essential characteristics of participants that you want to recruit?
Molecular events that occurs when neurons are stimulated : Explain and illustrate with a figure the molecular events that occurs when neurons are stimulated.
Write an analytical summary of the article : Write an analytical summary of the article focusing on the article's main claims. Include the following: Identify and discuss three ways the author.
What statements are used in jumping statements of java : JAVA - CONTROL STATEMENTS - What are the categories of control statements are available - Which looping statement is used for array of values
Glutamate using alpha-ketoglutarate : Describe the two enzymatic processes by which NH4+ can be assimilated into glutamate using alpha-ketoglutarate
Specific example of everyday biochemistry : Name the three major types of membrane lipids in animal cells and provide a specific example of "everyday biochemistry" illustrating the function of each type
Oxygen-carrying capacity of hemoglobin : High concentrations of 2,3-BPG and carbon monoxide both inhibit the oxygen-carrying capacity of hemoglobin.
What are some specific moral reasons people may reject : What are various ways the gospel message is perceived in our culture?What are some specific moral reasons people may reject the gospel message?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd