Answer:
Explanation:
A null pointer is pointing to nothing, if we can detect if a pointer is null, we can use an "IF" because a null pointer always going to be false, a null pointer even can block an application, because is a result of undefined behavior, it can even cause problems because the compiler can’t tell whether we mean a null pointer or the integer 0, there is a confusion in this kind of pointers.
Answer: A) It is directly accessible only in B1
Explanation: In the given chunk of code, Class B1 is a base class. Class B2 is derived class of class B1. Class B3 is derived class of B2. As you can see class B1 has two members or instance variables i and j. Instance variable cannot be directly accessible by both B2 and B3. If you see this statement of the given code private int j; the keyword private is used with the variable j. This keyword is called access specifier. Access specifiers specifies how the members of a class can be accessed. These members are attributes and methods of that class. Any member of a class that are declared private cannot be inherited by derived classes of that class. Additionally these private members cannot be accessed from within any method inside derived class. So j is directly accessible only in B1. You can access a private instance variable from within the same class or can access it through the methods of class.
Answer:
Follows are the code to the given question:
def steps_to_miles(user_steps):#defining a method steps_to_miles that takes a variable user_steps
return user_steps/2000#use return to calculate the steps
user_steps = int(input())#defining a variable user_steps that holds value from the user-end
print('%0.2f' % steps_to_miles(user_steps))#defining print that calls the steps_to_miles method
Output:
5345
2.67
Explanation:
In this code a method "steps_to_miles" that takes "user_steps" in the parameter inside the method a return keyword is used that calculates the user steps and return its values.
Outside the method, a "user_steps" variable is declared that inputs the value from the user-end pass into the method and prints its value.
Answer: Using secure copy 'SCP' we can copy all files from a remote directory into local folder. It also replaces existing files.
Explanation:
This is illustrated as follows:
scp -r [email protected]:/path/to/server/source/folder/ .
-r is recursively copy all files
username is your username in your system
IP, here you cab specify the IP or type the website such as www.google.com
Then we specify the path, complete path
"." dot here refers the current directory. To copy the contents in the current directory.
Answer: data loss protection
Explanation:
In any organization or enterprise it is very essential to provide protection from data loss to avoid breaches by unauthorized accesses and to secure the data irrespective of whether it is in rest or motion.
It is known that data changes its form when it is copied, moved and stored in different memory location so in this process a lot of sensitive data might be exposed to the outside world and left into the hands of the unauthorized for easy of access to it.
So once a security breach is possible through the system or into the network of the organization it would expose all the application database, emails, spreadsheets and the personal workstation files. So in such a scenario the importance of data loss protection is highlighted and must be given due importance.