Polymorphism
When methods understand the same message but it means different things, so, if we have two classes and both classes have a method called toString()
Each classes toString() will do something slightly different.
When methods are overridden we can say that they are Polymorphic
Heisenberg - Digital Alchemist, Software Architect, Automation Specialist and Mechanical Engineer.
Labels
Android
(1)
Apache
(1)
bash
(2)
boost
(2)
C
(36)
C++
(4)
cheatsheet
(2)
CLion
(6)
css
(3)
Debian
(33)
DL
(17)
Docker
(3)
Dreamweaver
(2)
Eclipse
(3)
fail2ban
(5)
git
(6)
GitHub
(5)
Hacking
(4)
html
(8)
http
(1)
iOS
(1)
iPad
(1)
IRC
(1)
Java
(33)
javascript
(3)
Linux
(178)
Mac
(21)
Machine Learning
(1)
mySQL
(52)
Netbeans
(6)
Networking
(1)
Nexus
(1)
OpenVMS
(6)
Oracle
(2)
Pandas
(3)
php
(17)
Postgresql
(8)
Python
(9)
raid
(1)
RedHat
(15)
Samba
(2)
Slackware
(50)
SQL
(14)
svn
(1)
tar
(1)
ThinkPad
(1)
Virtualbox
(4)
Visual Basic
(2)
Visual Studio
(1)
Windows
(5)
Monday, 27 February 2017
Tuesday, 17 January 2017
Formal Argument v Actual Argument
Formal Argument...
Formal when declaring and the Actual is when called.
public doSomething (Frog aFrog) //Formal
dosomething(jimmy) // Actual
Formal when declaring and the Actual is when called.
public doSomething (Frog aFrog) //Formal
dosomething(jimmy) // Actual
Monday, 16 January 2017
call a non static method from within a static method
To call a non static method from within a static method, do as below;
Monday, 9 January 2017
Exceptions in Java
ArithmeticException – an instance of this class is thrown when an exceptional arithmetic condition has occurred; for example, when integer division by zero has occurred.
NullPointerException – an instance of this class is thrown when you try to send a message to a reference variable whose value is null; that is, it does not reference an object. (The use of the word ‘pointer’ rather than ‘reference’ is a curiosity of the language, a throwback to C language terminology.)
NumberFormatException – an instance of this class is thrown to indicate that a method that converts a string to one of the numeric types has been passed an argument that does not have the appropriate format.
IndexOutOfBoundsException – an instance of this class is thrown when a program tries to access a string with an index outside the valid limits.
NullPointerException – an instance of this class is thrown when you try to send a message to a reference variable whose value is null; that is, it does not reference an object. (The use of the word ‘pointer’ rather than ‘reference’ is a curiosity of the language, a throwback to C language terminology.)
NumberFormatException – an instance of this class is thrown to indicate that a method that converts a string to one of the numeric types has been passed an argument that does not have the appropriate format.
IndexOutOfBoundsException – an instance of this class is thrown when a program tries to access a string with an index outside the valid limits.
Sunday, 8 January 2017
public static final
public static finalpublic static final int HOURS_IN_DAY = 24;Monday, 26 December 2016
Java Method Overriding
Declaring a method in subclass which is already present in parent class is known as method overriding.
Java Method Overloading
Method Overloading is a feature that allows a class to have two or more methods having same name but ONLY if their argument lists are different.
Sunday, 11 December 2016
namespace std C++
Use of namespace std as below;
#include<iostream>
using namespace std;
int main()
{
cout<<("Hello there...")<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
cout<<("Hello there...")<<endl;
return 0;
}
Compile C/C++ in Linux
gcc source.c -o executable.o
OR
g++ source.c -o executable.o
chmod +x executable.o
./executable.o
OR
g++ source.c -o executable.o
chmod +x executable.o
./executable.o
Saturday, 3 December 2016
C++ Note on Declarations
In C++ we must declare a Function/Routine before we use it UNLESS it appears in code before it is first used.
Subscribe to:
Posts (Atom)