
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9150 Articles for Object Oriented Programming

74K+ Views
In JavaScript, the object is a real-time entity that contains properties and methods. In simple words, we can say that object is an instance of a class. It stores the data in the form of key and value pairs. The keys are usually referred to as properties and the values are referred to as property values. There are two ways to define an object in JavaScript. Syntax var obj = new Object(); (or) var obj = {property1: value, property2 : value2 …….} Using dot (.) operator In JavaScript, using the dot (.) operator we can access a variable ... Read More

198 Views
add and assignment(+=) operatorThe add and assignment(+=) operator reduces the code little bit.It may not much influential in small codes whereas coming to long codes it's use can't be ignored. Live DemoExample var tot = 0; var a = [1,45,78,9,78,40]; for(var i = 0; i

1K+ Views
In JavaScript finally is a block of code or statements that are executed in all cases while handling errors with a try and catch block whenever used. These try, catch and finally blocks in JavaScript will execute the code that is prone to error and may cause the program to behave incorrectly (terminate abruptly). This finally block is positioned after the try and catch blocks, will unquestionably be executed if either of those blocks, try or catch, is ever executed. The finally block allows us to define the actions that must be performed regardless of whether some code succeeds or ... Read More

247 Views
The use of "=" operator is that it assigns value from right to left, whereas "==" shows whether the given values are equal or not.In the following example variables x and y were assigned values using "=" operator and their magnitudes were checked using "==" operator.Example Live Demo var x = 5; var y = "6"; document.write(x); document.getElementById("equal").innerHTML = (x == y); Outputfalse 5

179 Views
The difference between '==' and '===' is that former checks only value but the latter checks value and also data type(String, Boolean etc).The following example gives whether values assigned are equal or not irrespective of datatype. a) "==" operator(checks equality) Example Live Demo var x = 5; var y = 5; var z = 6; document.getElementById("strict").innerHTML = (x == y) + "" + (x == z); Outputtrue falseb) '===' operator (Checks strict equality) "===" operator gives true if and only if both value and data type are equal.If not it returns false.In ... Read More

10K+ Views
The SQL Count() function returns the number of rows in a table. Using this you can get the number of rows in a table.select count(*) from TABLE_NAME;Let us create a table with name cricketers_data in MySQL database using CREATE statement as shown below −CREATE TABLE cricketers_data( First_Name VARCHAR(255), Last_Name VARCHAR(255), Date_Of_Birth date, Place_Of_Birth VARCHAR(255), Country VARCHAR(255), );Now, we will insert 5 records in cricketers_data table using INSERT statements −insert into cricketers_data values('Shikhar', 'Dhawan', DATE('1981-12-05'), 'Delhi', 'India'); insert into cricketers_data values('Jonathan', 'Trott', DATE('1981-04-22'), 'CapeTown', 'SouthAfrica'); insert into cricketers_data values('Kumara', 'Sangakkara', DATE('1977-10-27'), 'Matale', 'Srilanka'); insert into cricketers_data values('Virat', 'Kohli', DATE('1988-11-05'), 'Delhi', ... Read More

1K+ Views
Yes, just like any other objects in Java we can pass a ResultSet object as a parameter to a method and, return it from a method.Let us create a table with name MyPlayers in MySQL database using CREATE statement as shown below −CREATE TABLE MyPlayers( ID INT, First_Name VARCHAR(255), Last_Name VARCHAR(255), Date_Of_Birth date, Place_Of_Birth VARCHAR(255), Country VARCHAR(255), PRIMARY KEY (ID) );Now, we will insert 7 records in MyPlayers table using INSERT statements −insert into MyPlayers values(1, 'Shikhar', 'Dhawan', DATE('1981-12-05'), 'Delhi', 'India'); insert into MyPlayers values(2, 'Jonathan', 'Trott', DATE('1981-04-22'), 'CapeTown', 'SouthAfrica'); insert into MyPlayers values(3, 'Kumara', 'Sangakkara', ... Read More

2K+ Views
The SQL TRUNCATE statement is used to delete all the records from a table.SyntaxTRUNCATE TABLE table_name;To delete all the records from a table from using JDBC API you need to −Register the Driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect to the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password (String) as parameters to it.Create Statement: Create a Statement object using the createStatement() method of the Connection interface.Execute the Query: Execute the query using the execute() method of the Statement interface.Following JDBC program ... Read More