Answer:
if(isBalloon== true && isRed==false) //compare the value of isBalloon variable with true value and isRed variable value with false value.
System.out.println("Balloon");//Print Balloon
else if(isBalloon== true && isRed==true) //compare the value of isBalloon variable with true value and isRed variable value with also true value.
System.out.println("Red balloon");//Print Red Balloon
else // when no if condition match it will execute.
System.out.println("Not a balloon"); //Print Not a Balloon
Output:
Not a balloon
Explanation:
The "if-else" statement is defined above for the problem which is given on the question. The detailed explanation of the answer is described below--
- Firstly we need to check the "true" value for the "isBalloon" variable and "false" value for "isRed" variable. This is done in "if" statement separated with and(&&) operator which gives "true" when both are the true statement.
- Then we need to check the "true" value for the "isBalloon" variable and "isRed" variable. For this, we need to use "else if" statement which executes when "if" statement is false.
- Then we need to print the "Not a balloon" statement if both cases are false, for this, we use "else" statement which executes when the "if" and "else if" statement are false.
Answer:
Check your DNS settings
Explanation:
Different errors may occur when setting up your computer to connect to the internet, one of which is described in the question above.
The DNS (Domain Name System) is responsible for redirecting domain names to their physical IP address. Instead of remembering every IP address of sites you visit frequently, domain names are used for easy remembrance, the DNS makes the matching of domain names to IP addresses possible.
To change your DNS setting follow these steps:
- Click settings from your start menu
- Click on Network and Internet
- Look to the bottom of the main page and click on "Network and Sharing Center"
- On the left tab, click "Change adapter settings"
- Right Click on the current network you are using and select properties
- Left-click on the "Internet Protocol Version 4 (TCP/IPv4) and click on properties.
- Check to see if "Obtain DNS server address automatically" is selected, if it is selected,
- Click on the radio button under it "Use the following DNS server address"
- Enter the DNS address you want to use
- Click Ok and close the window.
The problem should be resolved.