Comment<span> (computer programming) ... In computer programming, a </span>comment<span> is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.</span>
Answer:
a. Protected
b. Public
Explanation:
There are four acess modifier in Java.
Default: Acessible only within the same package.
Public: Can be acessed by any class.
Private: Acessible only within the class.
For example, you have a class employee and a private method. This method can only be accessed by an object that is an instance of an employee.
Protected: Used in classes that extend each other. For example, a class of employees would extend employee.
So:
a. A class Employee records the name, address, salary, and phone number.
The best acesses modifier is protected. A class may extended employee but have the same arguments(name, adress, salary, phone number), so it should also have acess to the method.
b. An adding method inside of a class BasicMath.
This method can be used in a variety of packages and projects and classes... and there is no important information regarding security. So the best method is public.
Answer:
The output streams to this question is "output.print(message)".
Explanation:
The description of the following can be given as:
- In the given question it is define a string datatype variable that is "message".
- Then we create a reference variable of PrintWriter class that is "output" and call string type variable that is message by the use of the print function we print message.
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The question is about writing a C program that prints the initial letter of Name Ferdous.
Therefore, below is the given complete code that prints the first letter of the name Ferdous.
<em>#include <stdio.h> </em><em>/*import strandard input/output library*/</em>
<em>#include<string.h></em><em> /*import string library to handle string type of data*/</em>
<em> </em>
<em>int main(void) </em><em> /*started the program execution- program entry point*/</em>
<em>{ </em>
<em>char *str = "Firdous";</em><em> /*char to pointer str contains string "Firdous"*/</em>
<em>int len = strlen(str); </em><em> /*this line of code is not neccary, but if you print other character for example last character of the name then you can use it*/</em>
<em>printf("First Letter of the name is: %c", str[0]); </em><em> /*print first letter of the name*/</em>
<em>} </em><em> /**program terminated*/</em>