How do you make a variable into a constant?

1 Answer

Answer :

A: By adding the keyword ‘final’ before a variable declarations. Example: final int a
= 5;

Related questions

Description : What is a class variable?

Last Answer : A: Instance variables having the keyword ‘static’ before it is a class variable. For every object there is just one copy of the variable made.

Description : What is a variable?

Last Answer : A: A variable is a named memory location whose value can change.

Description : State true of false. i) Public can only be assigned to class ii) Protected protects a statement iii) Protected method is never accessible outside the package iv) Friendly variable may be accessible outside class A) i- ... -false, ii-true, iii-false, iv-false D) i-true, ii-false, iii-false, iv-true

Last Answer : C) i-false, ii-true, iii-false, iv-false

Description : If a variable is declared final, it must include ...................... value. A) integer B) no C) initial D) float

Last Answer : C) initial

Description : In Java variables, if first increment of the variable takes place and then the assignment occurs. This operation is also called ............................. . A) pre increment B) post increment C) incrementation D) pre incrementation

Last Answer : A) pre increment

Description : Which of the following is not mandatory in variable declaration? A) a semicolon B) an identifier C) an assignment D) a data type

Last Answer : C) an assignment

Description : A variable is defined within a block in a body of a function. Which of the following are true? A) It is visible throughout the function. B) It is visible from the point of definition to the end ... visible from the point of definition to the end of the block. D) It is visible throughout the block.

Last Answer : D) It is visible throughout the block.

Description : Which of the following is true about the static member variable in C++. i) It is initialized to zero when the first object of its class is created. Other initialization is also permitted. ii) It is visible only within ... , ii-True B) ii-False, ii-True C) i-True, ii-False D) i-False, iii-False

Last Answer : B) ii-False, ii-True

Description : Which of the following cannot be passed to a function? A) Reference variable B) Arrays C) Class objects D) Header files

Last Answer : D) Header files

Description : Which of the following is FALSE in C? A) Keywords can be used as variable names B) Variable names can contain a digit C) Variable names do not contain a blank space D) Capital letters can be used in variables

Last Answer : A) Keywords can be used as variable names

Description : Assume that variable x resides at memory location 1234, y at 1111 and p at 2222. Int x=1, y=2, *p; p=&x; y=*p; What will be the value of y after execution of above code? A) 2 B) 1 C) 1234 D) 1111

Last Answer : C) 1234

Description : In C a variable cannot contain A) Blank Spaces B) Decimal Point C) Hyphen

Last Answer : A) Blank Spaces

Description : Pointer holds A) Value of variable B) Address of variable C) Value and address of variable D) Always null

Last Answer : B) Address of variable

Description : If a is an integer variable, a=7/3; will return a value A) 2.5 B) 3 C) 0 D) 2

Last Answer : D) 2

Description : ………………….. implies that all subnets obtained from the same subnet mask. A) Static subnetting B) Dynamic subnetting C) Variable length subnetting D) Both B and C

Last Answer : A) Static subnetting

Description : ........ implies that all subnets obtained from the same network use the subnet mask. A) Static subnetting B) Dynamic Subnetting C) Variable length subnetting D) Both B and C

Last Answer : A) Static subnetting

Description : At any iteration of simplex method, if Δj (Zj – Cj) corresponding to any nonbasic variable Xj is obtained as zero, the solution under the test is (A) Degenerate solution (B) Unbounded solution (C) Alternative solution (D) Optimal solution

Last Answer : (C) Alternative solution

Description : A data file of 1,00,000 characters contains only the characters g-l, with the frequencies as indicated in table:  using the variable-length code by Huffman codes, the file can be encoded with (A) 2,52,000 bits (B) 2,64,000 bits (C) 2,46,000 bits (D) 2,24,000 bits

Last Answer : (D) 2,24,000 bits 

Description : Find the false statement: (A) In Modern Cryptography, symmetric key algorithms use same key both for Encryption and Decryption. (B) The Symmetric cipher DES (Data Encryption Standard) was widely used ... and 124 bits. (D) Public key algorithms use two different keys for Encryption and Decryption.

Last Answer : (C) The AES (Advanced Encryption Standard) cryptosystem allows variable key lengths of size 56 bits and 124 bits.

Description : Which of the following is false for the programming language PROLOG? (A) A PROLOG variable can only be assigned to a value once (B) PROLOG is a Strongly Typed Language. (C) The scope of a variable in PROLOG is a single clause or rule. (D) the scope of a variable in PROLOG is a Single Query

Last Answer : (B) PROLOG is a Strongly Typed Language.

Description : A basic feasible solution of a linear programming problem is said to be ............... if at least one of the basic variable is zero. (A) degenerate (B) non-degenerate (C) infeasible (D) unbounded

Last Answer : (A) degenerate 

Description : When one object reference variable is assigned to another object reference variable then (A) a copy of the object is created. (B) a copy of the reference is created. (C) a copy of the ... not created. (D) it is illegal to assign one object reference variable to another object reference variable.

Last Answer : (B) a copy of the reference is created.

Description : There are three processes P1, P2 and P3 sharing a semaphore for synchronising a variable. Initial value of semaphore is one. Assume that negative value of semaphore tells us how many processes are waiting in queue. Processes access ... The final value of semaphore will be: (1) 0 (2) 1 (3) -1 (4) -2 

Last Answer : Answer: 1

Description : The process of dividing an analog signal into a string of discrete outputs, each of constant amplitude, is called: (A) Strobing (B) Amplification (C) Conditioning (D) Quantization

Last Answer : (D) Quantization

Description : What is a constant?

Last Answer : A: A constant is a literal which cannot be changed.

Description : An integer constant in C must have A) At least one digit B) At least one decimal point C) A comma along with digits D) Digits separated by commas

Last Answer : A) At least one digit

Description : Which of the following cannot be passed to a function in C++? (1) Constant (2) Structure (3) Array (4) Header file

Last Answer : Answer: 4

Description : What is the difference between a variable and a constant in Arduino?

Last Answer : In Arduino, a variable is a memory location used to store data that can change during program execution, while a constant is a value that is defined at compile time and cannot be changed during program execution.

Description : The work done by a weightless piston in causing an expansing `Delta V` (at constant temperature), when the opposing pressure P is variable, is given b

Last Answer : The work done by a weightless piston in causing an expansing `Delta V` (at constant temperature), when the opposing ... 0 C. `W = -P Delta V` D. None

Description : Hinge region, the region of Ig molecule which is flexible and more exposed to enzymes is the (A) Region between first and second constant regions of H chain (domains CH1 and CH2) (B) Region between second and ... H chain (CH2 and CH3) (C) Variable regions of H chain (D) Variable regions of L chain

Last Answer : Answer : A

Description : The class specific function of the different immunoglobulin molecules is constituted by (A) Variable region of L chain (B) Constant region of H chain (C) Variable region of H chain (D) Constant region particularly CH2 and CH3 of H chain

Last Answer : Answer : D

Description : The portion of the immunoglobulin molecule that binds the specific antigen is formed by (A) Variable regions of H and L chains (B) Constant region of H chain (C) Constant region of L chain (D) Hinge region

Last Answer : Answer : A

Description : Bence-Jones proteins possess all the following properties except (A) They are dimers of light chains (B) Their amino acids sequences are identical (C) Their N-terminal halves have variable amino acid sequences (D) Their C-terminal halves have constant amino acid sequences

Last Answer : Answer : B

Description : A light chain gene is constructed from the following segments: (A) Variable and constant segments (B) Variable, joining and constant segments (C) Variable, diversity and constant segments (D) Variable, joining, diversity and constant segments

Last Answer : Answer : B

Description : The effector function of antibody is performed by (A) Variable region of light chains (B) Constant region of heavy chains (C) Variable regions of light and heavy chains (D) Constant regions of light and heavy chains

Last Answer : Answer : D

Description : Recognition of antigen is the function of (A) Variable region of light chains (B) Variable regions of light and heavy chains (C) Constant region of heavy chains (D) Constant regions of light and heavy chains

Last Answer : Answer : B

Description : The mass of a body is different from its weight because 1. mass is a variable quantity whereas weight is constant 2. mass varies very little at different places whereas weight varies a lot 3. mass is constant but weight decreases as ... is/are correct? (a) 1 only (b) 2 and 4 (c) 3 only (d) 3 and 4

Last Answer : Ans:(d)

Description : If a change in all inputs leads to a proportionate change in output, it is case of - (1) Constant returns to scale (2) Diminishing returns to scale (3) Increasing returns to scale (4) Variable returns to scale

Last Answer : (1) Constant returns to scale Explanation: If output increases by that same proportional change as all inputs change then there are constant returns to scale (CRS). If output increases by less than ... by more than that proportional change in inputs, there are increasing returns to scale (IRS).

Description : Third stage of Law of Variable Proportion is called - (1) negative returns (2) positive returns (3) constant returns (4) increasing returns

Last Answer : (1) negative returns Explanation: The stages of Law of Variable Proportion are: Stage 1: Increasing return: Stage 2: Diminishing return; and Stage 3: Negative Return. In the third stage Marginal Product of variable factor is zero. In this stage the Total Product starts diminishing.

Description : Shunt, series, and compound wound motors, are all DC motors designed to operate from _____________. A. constant potential, variable current DC sources B. variable potential, constant current DC ... C. variable potential, variable current DC sources D. constant potential, constant current DC sources

Last Answer : Answer: A

Description : Out of constant pressure and constant volume lines on TS diagram which line has higher slope ? And whether slope is constant or variable ?

Last Answer : Constant volume line. Slope is variable.

Description : Gradient of force-extension graph is A. variable B. increasing C. decreasing D. force constant

Last Answer : force constant

Description : The principal stress ha a a. Variable b. Constant c. Constant & variable d. None

Last Answer : b. Constant

Description : The corresponding Existential Instantiation rule: for the existential quantifier is slightly more complicated. For any sentence a, variable v, and constant symbol k that does not appear elsewhere in the knowledge base. a) True b) False

Last Answer : a) True

Description : A Term is either an individual constant (a 0-ary function), or a variable, or an n-ary function applied to n terms: F(t1 t2 ..tn). a) True b) False

Last Answer : a) True

Description : A micro operation every bit of a register is a: a. Constant b. Variable c. Both d. None

Last Answer : b. Variable

Description : The pressure inside a piston cylinder is a variable of a) Radius b) Plane angle c) Z plane distance d) Constant, not a variable

Last Answer : c) Z plane distance

Description : Vector transformation followed by coordinate point substitution and vice-versa, both given the same result. Choose the best answer. a) Possible, when the vector is constant b) Possible, when the vector is variable c) Possible in all cases d) Not possible

Last Answer : a) Possible, when the vector is constant

Description : . A Rotameter works on the principle of __________ pressure drop. (A) Constant (B) Variable (C) Both (A) & (B) (D) Neither (A) nor (B)

Last Answer : (A) Constant