Answer:
import java.util.Scanner;
public class num5 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter The First String");
String str1 = in.next();
System.out.println("Enter The Second String");
String str2 = in.next();
System.out.println("Enter The Third String");
String str3 = in.next();
String oneAndTwo = str1+str2;
if(str3.equals(oneAndTwo)){
System.out.println(str1+" + "+str2+" is equal to "+str3+"!");
}
else
System.out.println(str1+" + "+str2+" is not equal to "+str3+"!");
}
}
Explanation:
- Implemented in Using Java Programming Language
- Import Scanner Class to prompt and receive users' input
- Create three string variables and store the three values entered by the user (str1, str2 and str3)
- Concatenate str1 and str2 using the + operator and assign to a new variable
- Use the if statement with Java's .equals() method to check for equality of the new string with the third string
- Print the appropriate message if the equal or not
The frame is a part of the web page or browser window
D
Explanation:
D.spread sheet
........,,............:-)
Answer:
Option (B) is the correct answer of this question.
Explanation:
In the Private access modifier we can access the property and field within the package or class we cannot accessing the member outside the class .
- We use private keyword for declaring the private access modifier.
- In the public access modifier we accessing the property outside the class so it's a incorrect option .
- In the protected access modifier we access the property of class package and subpackage both so it's a incorrect option.
- The default modifier is incorrect it not follow the given scenario so it's incorrect.
To understand how the code can be improved