What is a class variable?

1 Answer

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.

Related questions

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 : 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 : How do you make a variable into a constant?

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

Description : What is a variable?

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

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 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 : What is an abstract class?

Last Answer : A: An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

Description : Name some function of Scanner class.

Last Answer : A: next(), nextInt(), hasNextInt() etc.

Description : Name some function of StringTokenizer class.

Last Answer : A: nextToken(), countToken(), hasMoreTokens() etc.

Description : What are wrapper class?

Last Answer : A wrapper class is a class which wraps (encloses) around a data type and gives it an object appearance. Wherever, the data type is required as an object, this object can be used.

Description : Can a package be called as a class?

Last Answer : A: Yes, Package is actually a class present in java.lang package.

Description : What is a class?

Last Answer : A: A class is a blueprint or prototype from which objects are created.

Description : Each method in a java class must have a unique name . A) Not necessary B) True C) False D) None of the above

Last Answer : A) Not necessary

Description : State true or false. i) Jpanel is a class included in awt package. ii) Anonymous classes are mostly used for event handling. iii) Names of anonymous classes must be unique iv) JOptionPane is an inner class A) i-false ... ) 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 : Using which keyword we can access value of the instance variables and class variables of that class inside the method of that class itself. A) super B) final C) this D) either super or this

Last Answer : C) this

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : The class at the top of exception class hierarchy is .......................... A) ArithmeticException B) Throwable C) Class D) Exception

Last Answer : B) Throwable

Description : ...................... of a remotely accessible object must implement ................ A) all methods, RemoteException B) class, RemoteException C) class, RemoteInterface D) all methods, RemoteInterface

Last Answer : C) class, RemoteInterface

Description : State true or false for Java Program. i) Data members of an interface are by default final ii) An abstract class has implementations of all methods defined inside it. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

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

Description : State true or false for Java Program. i) All class variables are instance variables ii) All protected methods are friendly methods A) i-false, ii-false B) i-false, ii-true

Last Answer : B) i-false, ii-true

Description : The out object is an object encapsulated inside the ................. class, and represents the standard output device. A) standard B) local C) globlal D) system

Last Answer : D) system

Description : State true of false. i) AWT is an extended version of swing ii) Paint( ) of Applet class cannot be overridden A) i-false, ii-false B) i-false,ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : A) i-false, ii-false

Description : When a program class implements an interface, it must provide behavior for A) two methods defined in that interface B) any methods in a class C) only certain methods in that interface D) all methods defined in that interface

Last Answer : D) all methods defined in that interface

Description : All java classes are derived from A) java.lang.Class B) java.util.Name C) java.lang.Object D) java.awt.Window

Last Answer : D) java.awt.Window

Description : Native – protocol pure Java converts ……….. into the ………… used by DBMSs directly. A) JDBC calls, network protocol B) ODBC class, network protocol C) ODBC class, user call D) JDBC calls, user call

Last Answer : A) JDBC calls, network protocol

Description : Which is the root class of all AWT events A) java.awt.ActionEvent B) java.awt.AWTEvent C) java.awt.event.AWTEvent D) java.awt.event.Event

Last Answer : B) java.awt.AWTEvent