Answer:
e) Code segment II produces correct output for all values of str, but code segment I produces correct output only for values of str that contain "pea" but not "pear".
Explanation:
<em>if - elseif - else statements work in sequence in which they are written. </em>
- <em> </em>In case <em>if() statement is true, </em>else if() and else statements will not get executed.
- In case <em>else if() statement is true</em>, conditions in if() and else if() will be checked and else statement will not be executed.
- In case <em>if() and else if() both are false</em>, else statement will be executed<em>.</em>
First, let us consider code segment I.
In this, first of all "pea" is checked in if() statement which will look for "pea" only in the String str. So, even if "pearl" or "pear" or "pea" is present in 'str' the result will be true and "pea" will get printed always.
After that there are else if() and else statements which will not get executed because if() statement was already true. As a result else if() and else statements will be skipped.
Now, let us consider code segment II.
In this, "pearl" is checked in if() condition, so it will result in desired output.
Executable code is attached hereby.
Correct option is (e).
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
java
</span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
java
</span>
Answer: B) Shape is a base class, and circle and square are derived classes of Shape.
Explanation:
Shape is a base class because circle and squares are the shapes so these are the derived class of the shape, which is inherited by the shape like circle and square. As, the base class (shape) is the class which are derived from the other classes like circle and square and it facilitates other class which can simplified the code re-usability that is inherited from the base class. Base class is also known as parent class and the super class.
Agreed to all the terms mentioned in the contract
Answer:
Hackers frequently spend long hours examining the types and structures of targeted systems because they must use guile, or fraud to bypass the controls placed on information owned by someone else.
Explanation
The perception of a hacker has evolved over the years.
- The traditional hacker profile was a male, aged 14 to 18.
- 76% of hackers are men whose ages are between 14 years (8%) to 50 (11%). The average age is 35 years (43%).
- A hacker is persevering, patient, creative, bright and having a passion for what he does.
- Hackers today can be expert or novices.
- The experts create the software and schemes to attack computer systems.
- While the novices merely use software created by the experts.
The primary reason that you would import data into a database is because the data already exists somewhere else.
As an example, you may have a spreadsheet that contains names and telephone numbers of a group of people. It is much faster to import this data into a database instead of manually entering the information.