Answer:
The output is "A"
Explanation:
public class Solution {
public static void main(String args[]) {
mystery(7);
}
public static void mystery(int a) { System.out.println("A"); }
public static void mystery(double a) { System.out.println("B"); }
public static void mystery(int a, double b) { System.out.println("C"); }
public static void mystery(double a, int b) { System.out.println("D"); }
}
In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.
In the first case; mystery will be called if the argument is int.
In the second case; mystery will be called if the argument is double.
In the third case; mystery will be called if the arguments are int and double.
In the fourth case; mystery will be called if the arguments are double and int.
When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".
Answer:
Following are the code to the given points:
#include <iostream>//header file
using namespace std;
int main()//defining main method
{
cout<<"Hello World!"<<endl;//print message for code 1
cout<<"Hello world!\nHow are you?"<<endl;//print message for code 2
cout<<"Hello world!\nHow are you? \n \t (I'm fine).";//print message for code 3
return 0;
}
Output:
Please find the attached file.
Explanation:
In the given code, inside the main method, three print statement is used, that prints the given message which is defined in the question, for the printing of the message we use "\n, endl, and \t".
In which the "\n and endl" both are used in C++, to break the line into a new-line, and "\t" is used for providing a tab space.
Having a bachelor degree from a college gives the highest returns on investments. People who go to college usually secure high paying jobs compare to their counterparts who have less education.
The type of college one attends also matter, for instance in USA, the college in the first position, which gives the highest return on investment is Massachusetts Institute of Technology [MIT].
Answer:
The Correct answer for the given question is "elements " .
Explanation:
The number of bytes is always multiple by the number of array elements in an array to getting total memory occupy by any array .
For example :
int a[100];
Since in c language int is 2 bytes
So memory in number of bytes =2*100=200 bytes
Indexes is keep the track of physical location of any file this is also used to track the logical location of file in database so this option is wrong
Subscripts are the index number of an array so we will never used subscripts to getting total memory occupy by any array so this option is wrong
Iterators are the loop so this option is wrong.
Due to this the correct answer is elements.