Here is list of oops interview questions and answers for freshers and experienced from basic to advance Object Oriented Programming questions with examples . Net Interview Questions and Answers | OOPs Interview Questions with Answers PDF | OOPs Interview Questions in C++ c# .
Frequently asked .Net Interview Questions and Answers on Object Oriented Programming (OOPS) .NET Interview Questions and answers on OOPS.Here is List of questions.Frequently Asked Questions with answers.
Frequently asked .Net Interview Questions and Answers on Object Oriented Programming (OOPS) .NET Interview Questions and answers on OOPS.Here is List of questions.Frequently Asked Questions with answers.
- What is Abstract method?
- What is Polymorphisms?
- What is Virtual method?
- Can Struct be inherited?
- What is Object?
- What is Class?
- What is Static field?
- What is Static Method?
- What is Inheritance?
- What is Virtual keyword?
- What is New modifiers?
- What is Abstract Class?
- What is Sealed modifiers?
- What is an Interface?
- When to use Interface over abstract class?
- What is pure virtual function?
- Can we specify the access modifier for explicitly implemented interface method?
- What is Protected access modifier in C#?
- What is Public access modifier in C#?
- What is Private access modifier in C#?
- What is Internal access modifier in C#?
- What is Protected Internal access modifier in C#?
- What is method overloading?
- What is Overriding?
- What is Method overloading?
- What is Method Overriding? How to override a function in C#?
- Can we call a base class method without creating instance?
- In which cases you use override and new base?
- Difference between new and override keyword?
- What is a private constructor? Where will you use it?
- Can we declare private class in a Namespace?
- What is Polymorphism?
- What Are Attributes in DotNet?
- What can you do to make class available for inheritance but you need to prevent it's method to come in inheritance chain?
- What's the Difference between Interface and Abstract Class
- What are the various types of Constructors
- What are Constructors ?
- When to Use Abstract Classes and When Interfaces.
- Diversities between an abstract method & virtual method ?
- What is Early binding and late binding?
- How's method overriding different from overloading?
- What does the keyword virtual mean in the method definition?
- Can you declare the override method static while the original method is non-static?
- Can you override private virtual methods?
- Can you prevent your class from being inherited and becoming a base class for some other classes?
- Can you allow class to be inherited, but prevent the method from being over-ridden?
- Why can't you specify the accessibility modifier for methods inside the interface?
- Static datamembers should be initialized inside the constructor. True or False.
- Static methods can not use non static members. True or False.
- A constructor can be private. True or False?
- What is the work of a constructor?
- Name the operators that cannot be overloaded.
- What is "this" pointer?
- Difference between sealed and static classes.
- Differences between a structure and class.
- What are the different ways a method can be overloaded?
- Difference between a Class and an object.
- Define OOPS. What are its benefits?
- Can we have Sealed Method in abstarct class ?
- Can we have an Abstract class without having any abstract method ??
- Can we have Multiple Main Methods in one .cs file
- If the Function has same parameter but different return type (int and float), Is it a overloading?
- How does Composition mechanism works ?
- What is the advantage of parametric polymorphism ?
- What is difference in between abstrct classes and interfaces ?
- Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ? True or False ?
- What is the default access modifier of a class?
- Can a constructors that is declared within a base class, inherited by subclasses ? Yes or No
Following are the procedure to check databalance left in Mobile or in 2G , 3G E-Stick / Dongle for various Indian operators,this is USSD command can be dialed through mobile phone or direct dongle , some of the dongles are having USSD option in their dashboard/software .
Operator Name | Dial to Check Data Balance ( USSD ) |
Airtel 2G & 3G | *123*10# |
AIRCEL 2G & 3G | *123# |
BSNL 2G & 3G | *112# – Reply/Send “2″ For GPRS Day |
Idea 2g & 3g | Check SMS Inbox for balance left – check note
Dial *125#
|
Reliance GSM SMART 2G & 3G |
*333# Reply 1,3,1 Mobile Broadband Balance or
Dial *367*3# or
Send SMS “MBAL” to 55333 and you will Get a reply (for details check screenshot below)
|
Tata Docomo 2G & 3G | *111*1# |
Vodafone 2G & 3G | *111*6# for Prepaid
For Postpaid Dial *777*7*MDN#
MDN = 10 Digit Device/Dongle/Mobile No.
|
Videocon 2G & 3G | *123# |
Generally we will use onchange event of Dropdownlist in asp.net to raise dropdownlist selectedindexchanged event in JavaScript like as shown below
<asp:DropDownList runat="server" ID="ddlID" onchange="JavaScript:
onSelectChange ();">
</asp:DropDownList>
</asp:DropDownList>
<script>
function onSelectChange()
{
alert("hello
!");
}
</script>
You can also add Javascript function on dropdownlist onchange event from code behind page
file as follows.Just add bellowcode on Page_Load Event of Page.
ddlID.Attributes.Add("onChange", "return
onSelectChange ();");Error Message:
Msg 8152, Level 16, State 14, Line 2
String or binary data would be truncated.
The statement has been terminated.
Some time this error is occurred when we insert data into database.Check the Database Column Size and Data length. you will get this error when you are storing data of length greater than that of defined size.
Example:-
string MyData = "Error Message: String or binary data would be truncated. The statement has been terminated.";
int Mydatalength = MyData.Length; // will be more than 30 characters , greater than defined size
Customer.Name = MyData;
//you will get error for this line.
Because you have Name (varchar 25, null) in Database if you want to solve this error just increase the size of name column in database.
Sql Query Example:-
DECLARE @EmpDetails TABLE(EmpId INT, Name VARCHAR(25),Designation VARCHAR(10))
INSERT INTO @EmpDetails(EmpId,Name,Designation)
VALUES(1,'Rajesh','Error Message: String or binary data would be truncated. The statement has been terminated.')
SELECT * FROM @EmpDetails
If you watch above query here Designation field is declare with VARCHAR(10) and we trying to inserting more than 10 characters because of that you got error like .
Msg 8152, Level 16, State 14, Line 2
String or binary data would be truncated.
The statement has been terminated.
DECLARE @EmpDetails TABLE(EmpId INT, Name VARCHAR(25),Designation
VARCHAR(500))
VARCHAR(500))
INSERT INTO @EmpDetails(EmpId,Name,Designation)
VALUES(1,'Rajesh','Error Message: String or binary data would be truncated. The statement has been terminated.')
SELECT * FROM @EmpDetails
Javascript substring() syntax :
String.substring( from [, to ] )
This Javascript substring() method extracts the characters from a string between "from" and "to ", not including "to" itself.
Some Notes about Javascript Substring() Method:
If 'from' equals 'to', it returns an empty string.
If 'to' is omitted, it extracts characters to the end of the string.
If either argument is less than 0 or is NaN, it is treated as if it were 0.
If either argument is greater than string’s length, either argument will use string’s length.
If from >to, then substring will swap those 2 arguments.
Example of Javascript substring() Method :-
<script>
var str="Hello Javascript substring method";
document.write(str.substring(3,3)+"<br />");
document.write(str.substring(3)+"<br />");
document.write(str.substring(3,0)+"<br />");
document.write(str.substring(3,7)+"<br />");
document.write(str.substring(7,3)+"<br />");
</script>
The output of the code above will be:
empty string
lo Javascript substring method
Hel
lo J
lo J
Top 10 Javascript Article
Email Validation: Cross browser Email Validation in JS. JavaScript for Email Address Validation with explanation of the code.The script on this page has been updated to deal with cross-browser issues. Learn how to validate a users email address using Javascript.
Using Regular Expressions is probably the best way. Here's is an function Which will return true if Email is a Valid email and false if email is not valid .
<script>
function
validateEmail(email) {
var regstring
= /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\
".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA
-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return regstring.test(email);
}
</script>
But keep in mind that one should not rely only upon JavaScript validation. JavaScript can easily be disabled. This should be validated on the server side as well.
Textbox empty check using javascript,empty textbox validation with javascript ,JavaScript tutorial validate form: Textboxes,Client Side Validation using JavaScript for textbox empty check . how to write javascript alert message for empty textbox , javascript validation to a textfield to check for null.
If you have a textbox and you want to check that the box must not be null using javascript. the below javascript code will help you.
JavaScript Example Code
<script>
function
checknull()
{
if(document.getElementById("txttext").value=="")
{
alert("Please
enter value.");
return false;
}
}
</script>
You just call this function on Blur to event to check textbox is empty or having value.
onblur="
checknull() ;" -- add this to text box property Like below
<asp:TextBox ID="txttext" runat="server" Text="" onblur=" checknull();"></asp:TextBox>
All The Best !!!
If you have textbox in a form,when a user submits the form,it should check whether the user has filled it or not .The below javascript code will check whether a use filled the text box or left it the default value.this query will validate textbox.
I am trying to validate a text box so that if the default value for the text box or a blank value is provided, it prevents the form from being submitted.
Javascript code is as follows
<script >
function
checkForm()
{
if
(form1.elements['txttext'].value == "" || form1.elements['txttext'].value == "Default
Value")
{
alert("Please
Enter the value in textbox");
form1.elements['txttext'].focus();
return false;
}
else
{
form1.submit();
return true;
}
return true;
}
</script>
Aspx page code is as follows
<asp:TextBox ID="txttext"
runat="server"
Text="Default
Value"></asp:TextBox>
<asp:Button ID="btnsubmit"
runat="server"
Text="submit"
OnClientClick="return
checkForm()" />
Microsoft Office includes the ability to recover both an unsaved workbook that's newly created as well as the most recent previous version of an Excel workbook.Here in this tutorial you will learn how to recover Unsaved Excel File.After reading this article you can Recover an Unsaved Excel File.
Recover an Unsaved, New File
To Recover an Unsaved, New File Follow the below steps.
1- Open Excel and select the "File" menu.
2- Now Choose "Recent Document" and then "Recover Unsaved Workbooks." The saved drafts folder opens on your desktop.
3-Select the file you were working on and forgot to save. Select "File," and then "Save As."
Recover an Unsaved, Existing File
To Recover an Unsaved, Existing File Follow the below steps.
1-Open Excel and select the workbook in which you were working.
2-Select "File," and then select "Info."
3-From the list of versions, click the one labeled "when I closed without saving."
4-Click "Restore" . This selection overwrites the previous version of the workbook to the last version autosaved.
Video Tutorial-