![]() (b) Differentiate between Binary Search and Linear Search techniques.įor large arrays time required is very large.įor large arrays the time required is very less 1 byte = 8 bits so 20 bytes convert to 8 x 20 = 160 bits. As size of char is 2 bytes, a character array of 10 elements occupies 2 x 10 = 20 bytes. (a) State the number of bytes and bits occupied by a character array of 10 elements.Īns. if (a = 10) checks if variable a is equal to 10 or not It is the equality operator used to check if a variable is equal to another variable or literalĮ.g. It is the assignment operator used for assigning a value to a variable (e) Differentiate between = and = operators. The different constructors of the class are differentiated by the compiler using the number of parameters in the list and their types.įor example, a class Employee can have 3 constructors as shown below: Constructor overloading is a technique in Java through which a class can have more than one constructor with different parameter lists. There are four types of access specifiers:Īns. (d) Mention the types of access specifiers.Īns. There are different types of literals like integer literals, floating point literals, character literals, String literals, boolean literals and null literals. Any constant value which can be assigned to the variable is called as literal. Here we are creating an object of class Employee using the new keyword.Īns. The new keyword instantiates an array or a class by dynamically allocating memory for it at runtime and returning a reference to that memory.įor example: Employee emp = new Employee() (b) Explain the purpose of using a ‘new’ keyword in a Java program.Īns. ![]() The wrapping of data and methods that operate on that data into a single unit is called Encapsulation. The intended marks for questions or parts of questions are given in brackets.Īns. The time given at the head of this Paper is the time allowed for writing the answers.Īttempt all questions from Section A and any four questions from Section B. This time is to be spent in reading the question paper. ![]() You will not be allowed to write during the first 15 minutes. Answers to this Paper must be written on the paper provided separately. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |