Classify the following as primitive or non-primitive data types:
(i) char
(ii) arrays
(iii) int
(iv) classes

1 Answer

Answer :

Ans. (i) char – Primitive
(ii) arrays – Non primitive
(iii) int – Primitive
(iv) Classes – Non primitive

Related questions

Description : Classify the following as primitive or non-primitive data types: (i) char (ii) arrays (iii) int (iv) classes

Last Answer : Ans. (i) char – Primitive (ii) arrays – Non primitive (iii) int – Primitive (iv) Classes – Non primitive

Description : What are the types of casting shown by the following examples: (i) char c = (char)120; (ii) int x = ‘t’;

Last Answer : Ans. (i) Explicit casting (ii) Implicit casting

Description : Arrange the following primitive data types in an ascending order of their size: (i) char (ii) byte (iii) double (iv) int

Last Answer : Ans. The sizes of the given data types are as follows char = 2 bytes byte = 1 byte double = 8 bytes int = 4 bytes Arranging them in ascending order gives byte < char < int < double

Description : Name the operators listed below i) < ii) ++ iii) && iv) ?:

Last Answer : Ans. i) Less than comparison operator ii) Increment operator iii) And logical operator iv) Ternary operator

Description : If int y = 10 then find int z = (++y * (y++ + 5));

Last Answer : Ans. Increment operator has the highest precedence. So, ++y and y++ will be evaluated starting from left. In ++y, the value of y will be incremented to 11 and then 11 will be used in the expression. When y++ is evaluated, the current ... int z = (++y * (y++ + 5)); = 11 * (11 + 5 ) = 11 * 16 = 176

Description : int res = ‘A’; What is the value of res?

Last Answer : Ans. res will hold the ASCII value of ‘A’ which is 65.

Description : System.out.print(“BEST “); System.out.println(“OF LUCK”); Choose the correct option for the output of the above statements: (i) BEST OF LUCK (ii) BEST OF LUCK

Last Answer : Ans. (i) is the correct output. System.out.print() does not add a new line at the end because of which ‘OF LUCK’ gets printed on the same line as ‘BEST’.

Description : Name any two library packages.

Last Answer : Ans. java.util, java.io

Description : Write one difference between / and % operator.

Last Answer : Ans. / is division operator while % is modulus operator which gives the remainder on dividing two numbers.

Description : Write the output for the following: System.out.println(“Incredible” + “\n” + “world”);

Last Answer : Incredible world

Description : What is meant by a package.Give an example

Last Answer : Ans. Package in Java is a mechanism to encapsulate a group of classes, sub packages and interfaces., examples : lang , io , util etc..

Description : If the value of basic = 1500, what will be the value of tax after the following statement is executed tax = basic > 1200 ? 200 : 100

Last Answer : Ans. 200

Description : Write a difference between Unary and Binary Operator

Last Answer : Ans. Operators that acts on one operand are referred to as Unary Operators while Binary Operators acts upon two operand Unary + or Unary – , increment/decrement are the example of Unary operator While binary operator +,-,*,/ and % are the example of binary operators , (+) adds values of its operands

Description : State the number of bytes occupied by char and int data types.

Last Answer : Ans. char occupies two bytes and int occupied 4 bytes.

Description : Match List-I (Type of Unemployment) with List-II (Characteristics) and select the correct answer using the codes given below: L ist-I L ist -I I (Type of (Char acter ist ics) Unem ... contribution by the additional labour is nil E. Cyclical V. Job opportunities during certain months in the year

Last Answer : (1) A-V, B-III, C-IV, D-II, E-I

Description : Match List I (Layers of Atmosphere) and List II (Characteristics) and select the correct answer using the code given below. L ist I L i st I I (L ayer of (Char acter ist ics) At mospher e) A. Ionosphere I. Contains Ozone B. ... D-III (3) A-II, B-III, C-I, D-IV (4) A-III, B-I, C-IV, D-II

Last Answer : 2) A-II, B-I, C-IV, D-III

Description : What are the default values of the primitive datatypes int and float?

Last Answer : Ans. The default value of int is 0 and the default value of float is 0.0f.

Description : Classify the following mixtures as homogeneous and heterogeneous. (i)Tincture of iodine (iv)Sugar solution (ii)Smoke (iii)Brass -Chemistry

Last Answer : In the above classification, tincture of iodine, brass and sugar are homogenous mixture while the smoke is heterogeneous mixture. Tincture of iodine is a liquid solution, brass is an alloy made ... component. Smoke on other hand is composed of moisture and gas thus making the mixture heterogeneous.

Description : Classify the soil according to IS Classification and explain the meaning of following terms i) GW ii) SP iii) ML iv) SM-ML

Last Answer : As per IS classification soil is broadly divided into three divisions: 1. Coarse grained soil: In these soils, more than half the total material by mass is larger than 75 micron IS ... medium compressibility. iv) SM-ML - boundary classification between coarse grained and fine grained soils. 

Description : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

Description : Give output for following code: class student { int roll no; char name [14]; } s[6]; void main() { cout<<sizeof(s); }

Last Answer : Considering roll_no(Single variable) the output is: 96 OR Considering roll, no (Two variables) the output is: 108 OR Considering roll no the output is: error – space between roll and no

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : Which of the following has compilation error in C ? (A) int n = 32; (B) char ch = 65; (C) float f= (float) 3.2; (D) none of the above

Last Answer : D

Description : …………. Refer to the names of variables, functions, arrays, classes etc. created by the programmer. A) Keywords B) Identifiers C) Constraints D) Strings

Last Answer : B) Identifiers

Description : What are the Wrapper classes available for primitive types ?

Last Answer : Ans. boolean - java.lang.Boolean byte - java.lang.Byte char - java.lang.Character double - java.lang.Double float - java.lang.Float int - java.lang.Integer long - java.lang.Long short - java.lang.Short void - java.lang.Void

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 : State true or false. i) init() is called after start() in applet ii) applets are used for networking iii) inheritance is a part of Java Foundation Classes iv) final does not prevent inheritance A) i-true, ii- ... C) i-true, ii-true, iii-true, iv-true D) i-true, ii-false, iii-false, iv-false

Last Answer : B) i-false, ii-false, iii-false, iv-false

Description : Write one difference between primitive data types and composite data types.

Last Answer : Ans. A primitive data type is not composed of other data types. Ex: int, float, double while a composite data type is composed of other data types. Ex: class

Description : Which of the following are the solutions to network security? i) Encryption ii) Authentication iii) Authorization iv) Non-repudiation A) i, ii and iii only B) ii, iii and iv only C) i, iii and iv only D) All i, ii, iii and iv

Last Answer : Which of the following are the solutions to network security? i) Encryption ii) Authentication iii) Authorization iv) Non-repudiation A) i, ii and iii only B) ii, iii and iv only C) i, iii and iv only D) All i, ii, iii and iv

Description : Arithmetic and Logic Unit I. Perform Arithmetic operations II. Store Data III. Perform comparisons IV. Communicate with input devices Which of the following is true ? (1) I only (2) III only (3) I and II (4) I and III

Last Answer : I and III

Description : Write the name of layers that perform the following functions in OSI : I. Data Encryption II. Error Correction III. File Transfer IV. Data Encoding

Last Answer : 1. Data Encryption-Presentation Layer 2. Error Correction-Data link layer and Transport layer 3. File Transfer-Application layer 4. Data Encoding-Presentation layer

Description : An ER Model includes I. An ER diagram portraying entity types. II. Attributes for each entity type III. Relationships among entity types. IV. Semantic integrity constraints that reflects the business rules about data not ... ; IV (B) I&IV (C) I, II & IV (D) I & III

Last Answer : (A) I, II, III & IV

Description : Another name for 1-D arrays. a) Linear arrays b) Lists c) Horizontal array d) Vertical array

Last Answer : Answer: a Explanation: Linear arrays are the 1-Dimensional arrays wherein only one row is present and the items are inserted

Description : What are large randomly repeating non-coding DNA stretches called as? a. Satellite DNA b. Micro arrays c. Gene d. Allele

Last Answer : a. Satellite DNA

Description : Which of the following is not a primitive data type: a) String b) Double c) Boolean d) None of The Above

Last Answer : a) String

Description : Double is a ______ data type. (1) primitive (2) user defined (3) system defined (4) local

Last Answer : primitive

Description : Who manufactures non-activated carbon char?

Last Answer : my husband advises: try hickman-williams & co, oak brook, IL, or superior graphite company, chicago, IL, or asbury graphite company, asbury, NJ. these companies produce and market specialty carbon products; or they may know someone who does

Description : Identify the literals listed below: (i) 0.5 (ii)’A’ (iii) false (iv) “a”

Last Answer : Ans. (i) Floating point literal (ii) Character literal (iii) Boolean literal (iv) String literal

Description : Identify and name the following tokens: (i) public (ii) ‘a’ (iii) == (iv) { }

Last Answer : Ans. (i) public- Access Specifier (ii) ‘a’- character (iii) == is a Relational operator (iv) { } is a Curly braces, Java uses them for surrounding the bodies of loops, methods and classes.

Description : In packet-filtering router, the following information can be external from the packet header. i) Source IP address ii) Destination IP address iii) TCP/UDP source port iv) ICMP message type v) TCP/UDP destination port A) i, ii, ... iv and v only C) ii, iii, iv and v only D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : The following protocols and system are commonly used to provide various degrees of security services in computer network. i) IP filtering ii) Reverse Address Translation iii) IP security Architecture (IPsec) iv) Firewalls v) Socks A) ... v only C) ii, iii, iv and v only D) All i, ii, iii, iv and v

Last Answer : B) i, iii, iv and v only

Description : Which of the following operations can be performed by using FTP. i) Connect to a remote host ii) Select directory iii) Define the transfer mode iv) List file available A) i, and ii only B) i, ii and iii only C) ii, iii and iv only D) All i, ii, iii and iv

Last Answer : D) All i, ii, iii and iv

Description : The most important and common protocols associated TCP/IP internetwork layer are. i) Internet Protocol (IP) ii) Internet Control Message Protocol (ICMP) iii) Bootstrap Protocol (BOOTP) iv) Dynamic Host Configuration Protocol (DHCP) V) ... C) i, iii, iv and v only D) All i, ii, iii, iv and v only

Last Answer : D) All i, ii, iii, iv and v only

Description : Which of the following represents the step of scientific methodI- Develop hypothesis based on evidenceII- Calculate hash value of evidenceIII- Test the hypothesis to look for additional evidence IV-make an imaging of the original evidence A. All above B. I and III C. II and IV D. II, III and IV

Last Answer : B. I and III

Description : Which of the following represents the step of scientific method? I- Develop hypothesis based on evidence II- Calculate hash value of evidence III- Test the hypothesis to look for additional evidence IV-make an imaging of the ... a. I and IV b. I and II c. II, III and IV d. All of above

Last Answer : b. I and II

Description : State the functions of i. Repeater ii. Switch iii. Gateway iv. Bridges

Last Answer : i) Repeater: Repeaters are used to take the distorted, weak and corrupt input signal and regenerate this signal at its output. It ensures that the signals are not distorted or weak before it ... and decides whether to forward or discard it. It sends packets between two networks of same type.

Description : While creating a table named “Employee”, Mr. Rishi got confused as which data type he should chose for the column “EName” out of char and varchar. -Technology

Last Answer : Varchar would be the suitable data type for EName column as char data type is a fixed length data type while varchar is a variable length data type.Any employee‟s name will be of variable length so it‟s advisable to choose varchar over char data type.

Description : Define what are the primitive data types in c?

Last Answer : There are five different kinds of data types in C. Char Int Float Double Void

Description : Name the primitive data-types in java.

Last Answer : A: byte, short, int, long, float, double, char and boolean