Answer: In java the symbol "+" operator is used to perform string concatenation.
Explanation:
String concatenation refers to joining of two strings. So in java + is used to join strings which works provided one of the operands must be a String variable. Then it works by converting the other variable to String variable and joins the second operand to the end of the first operand.
An example of String concatenation is as follows:
int age = 10;
System.out.println("The boys age is " + age);
Output:
The boys age is 10.
here, the age is integer variable but as the phrase "The boys age is" is a String variable so it converts the age to String variable and joins both the Strings.
I would do top to down approach start from the top and work your way down to the bottom.
It is called vulnerabilities
Answer:
sendObject(John_Doe)
Explanation:
To invoke a method, simply call the name of the method, followed by it's arguments in parenthesis. i.e methodname(argument).
In this case, the name of the method is sendObject and it's argument is a Customer object stored in or referenced by a variable John_Doe.
The above is true since the method is defined in the same class that calls it. Otherwise, it is not valid.
Answer:
The program to this question can be defined as follows:
Program:
num=int(input("Enter any number: ")) #defining variable num, that take value from user
val=0; #defining variable val
for i in range(num): #defining loop to calculate value in decreasing order
val=num-i; #holding value in variable
print(val) #print value
Output:
Enter any number: 3
3
2
1
Explanation:
In the above-given code, a variable "num" is declared, that uses input function to take value from the user end, in the next line a "val" variable is defined, that calculates values and print it in decreasing order.
- In the next step, a for loop is declared, inside the loop a "val" variable uses num and loop variable "i" to calculate the value in decreasing order.
- In the last print method is used that prints "val" variable value.