Error Report! Toggle navigation. Question: 1 A structure is a data type in which A Elements can be of different type. B Each element must have the same type. C Each element must be of pointer type. D None of above View Answer. Ans: A Elements can be of different type. Question: 2 Preprocessor does not which one of the following?
Ans: A Macro expansion. What is function overloading? Function overloading is defined as a normal function, but it has the ability to perform different tasks. It allows creation of several methods with the same name which differ from each other by type of input and output of the function.
What is operator overloading? Operator overloading is a function where different operators are applied and depends on the arguments.
What is an abstract class? An abstract class is a class which cannot be instantiated. Creation of an object is not possible withabstract class , but it can be inherited. An abstract class can be contain members, methods and also Abstract method. A method that is declared as abstract and does not have implementation is known as abstract method. What is a ternary operator? Ternary operator is said to be an operator which takes three arguments.
Arguments and results are of different data types , and it is depends on the function. Ternary operator is also called asconditional operator. What is the use of finalize method? Finalize method helps to perform cleanup operations on the resources which are not currently used. Finalize method is protected , and it is accessible only through this class or by a derived class.
What are different types of arguments? A parameter is a variable used during the declaration of the function or subroutine and arguments are passed to the function , and it should match with the parameter defined. There are two types of Arguments. Call by Value — Value passed will get modified only inside the function , and it returns the same value whatever it is passed it into the function. Call by Reference — Value passed will get modified in both inside and outside the functions and it returns the same or different value.
What is super keyword? Super keyword is used to invoke overridden method which overrides one of its superclass methods. This keyword allows to access overridden methods and also to access hidden members of the super class. It also forwards a call from a constructor to a constructor in the super class. What is method overriding? Method overriding is a feature that allows sub class to provide implementation of a method that is already defined in the main class.
This will overrides the implementation in the superclass by providing the same method name, same parameter and same return type. What is an interface? An interface is a collection of abstract method.
If the class implements an inheritance, and then thereby inherits all the abstract methods of an interface. What is exception handling? Exception is an event that occurs during the execution of a program. Exceptions can be of any type — Run time exception, Error exceptions. Those exceptions are handled properly through exception handling mechanism like try, catch and throw keywords.
Token is recognized by a compiler and it cannot be broken down into component elements. Keywords, identifiers, constants, string literals and operators are examples of tokens. Even punctuation characters are also considered as tokens — Brackets, Commas, Braces and Parentheses.
Overloading is static binding whereas Overriding is dynamic binding. Overloading is nothing but the same method with different arguments , and it may or may not return the same value in the same class itself. Overriding is the same method names with same arguments and return types associates with the class and its child class. An object is an instance of a class. Definition of properties and functions can be done at class and can be used by the object. What is an abstraction?
Abstraction is a good feature of OOPS , and it shows only the necessary details to the client of an object. Means, it shows only necessary details for an object, not the inner details of an object.
Example — When you want to switch On television, it not necessary to show all the functions of TV. Whatever is required to switch on TV will be showed by using abstract class. What are access modifiers? Access modifiers determine the scope of the method or variables that can be accessed from other various objects or classes. There are 5 types of access modifiers , and they are as follows:. Here you can access and discuss Multiple choice questions and answers for various competitive exams and interviews.
Take a quick online test. Attempt a small test to analyze your preparation level. The questions asked in this NET practice paper are from various previous year papers. Toggle navigation. Online Test Take a quick online test. C Programs. C - Arrays and Pointers.
C - Stacks and Queues. C - Linked Lists. C - Matrices. Which was the first purely object oriented programming language developed? Java b. SmallTalk d. Answer: c. Which of the following best defines a class? Parent of an object b. Instance of an object c.
0コメント