1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
STatiana [176]
2 years ago
15

In ________ for final fields and methods the value is assignedlater but in ______ you assign the value during declaration.

Computers and Technology
1 answer:
Oksi-84 [34.3K]2 years ago
7 0

Answer:

The answer to this question is Java,C++.

Explanation:

We can assign non static final variables a value with the declaration or in the constructor but this is not the case with c++ because we have to assign value during declaration and c++ equivalent of final is const keyword and there is sealed or readonly keywords in c# not final.If we do not assign value at the time of declaration the const variable will contain garbage value which cannot be changed afterwards.

You might be interested in
Match the careers with the career clusters.
creativ13 [48]
<h2>Answer and Explanation:</h2>

The picture shows the right careers with their respective career clusters.

4 0
2 years ago
Read 2 more answers
Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the docum
gavmur [86]

Answer:

#include<iostream>

#include<fstream>

using namespace std;

int main()

{

ofstream out;

out.open("Hello.txt");

out << "Hello, World!"<< endl;

out.close();

ifstream in;

in.open("Hello.txt");

while(in.good()){

   string line;

   in >> line;

   cout << line << endl;

   

}

in.close();

return 0;

}

Explanation:

Step 1:

Add all your preprocessor files directive,  #include is known as the preprocessor  is used to load files needed to run the code.

#include<iostream>: it provides basic input and output services for C++ programs.

#include<fstream>:used to open a file for writing and reading

using namespace std; means you'll be using namespace std means that you are going to use classes or functions (if any) from "std" namespace

Step 2:

ofstream out; <em>his  is  used  to  create  files  and   write data to the file</em>

out.open("Hello.txt"); <em>  a new file "HELLO.txt" has been created</em>

out << "Hello, World!"<< endl;  "<em>Hello World!" has now been writen to the file</em>

out.close(); <em>The file is now closed</em>

<em>This second step opens a new file and writes hello world to the file then closes it.</em>

Step 3:

<em>ifstream in; ifstream in c++ is a stream class which stands for input file stream a  is used for reading data from file.</em>

in.open("Hello.txt"); <em>Reopens the file without recreating it. This is a very important step because if not done properly, you might discard the file you previously created and recreate it.</em>

while(in.good()){

<em> in.good() is true if the previous read operation succeeded without EOF being encountered</em>

   string line; <em>It declares a string variable line</em>

   in >> line; <em>reads the data into the line variable</em>

   cout << line << endl; <em>Prints out the line</em>

<em>reopens the file and read the message into a string variable "line".  prints out line then exits out of the file.</em>

5 0
3 years ago
A. Write a program that asks the user to enter an integer, then prints a list of all positive integers that divide that number e
kobusy [5.1K]

Answer:

Following are the program in python language the name of the program is factors.py

num= int(input("Please enter a positive integer: "))#Read the number by user

print("The factors of ",num,"are:")

for k in range(2,num): #iterating over the loop

   if(num%k==0): #checking the condition

       print(k)#display the factor

Output:

Please enter a positive integer: 12

The factors of 12 are:

2

3

4

6      

Explanation:

Following are the description of the program

  • Read the number by user in the "num" variable
  • Iterating the for loop from k=2 to less then "num".
  • In the for loop checking the factor of "num"  variable by using % operator.
  • Finally display the factor by using print function
4 0
3 years ago
Given a class called Measure that has the methods and data as specified, choose the correct code to satisfy the requirements of
Nina [5.8K]

Answer:

D

Explanation:

7 0
3 years ago
Which key toggles between insert mode and overtype mode?
andrew-mc [135]
The keyboard key that toggles between insert mode and overtype mode is the INSERT key.
7 0
2 years ago
Other questions:
  • Categories of functions specified by computer instruction?
    11·1 answer
  • A good reference point for determining the position of a line or curb in front of you is your __________ . A. Hood ornament B. L
    10·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • An array is sorted (in ascending order) if each element of the array is less than or equal to the next element .
    8·1 answer
  • Cassie is worried about credential management on a network where users often have over six passwords to remember. She’s curren
    13·1 answer
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • What does it mean to say that data in an Excel table is “dynamically linked” to a chart? What are the advantages of this feature
    5·1 answer
  • 17. Ano ang tawag sa pahina ng Excel?
    12·1 answer
  • What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!