Labels

Android (1) Apache (1) bash (2) boost (2) C (37) C++ (5) cheatsheet (2) CLion (6) css (3) Debian (35) DL (17) dns (1) 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 (34) javascript (3) Linux (186) Mac (22) Machine Learning (1) mySQL (54) Netbeans (7) Networking (1) Nexus (1) OpenVMS (6) Oracle (5) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (3) Slackware (54) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (8) wire (1)

Friday, 28 April 2017

Functions in VB

Public Function addSlash(ByVal temp As String)
        If Microsoft.VisualBasic.Right(temp, 1) <> "\" Then
            Return temp & "\"
        Else
            Return temp
        End If
End Function


'VB6
Public Function addSlash(temp As String)
    If Right(temp, 1) <> "\" Then
        addSlash = (temp + "\")
    Else
        addSlash = temp
    End If
End Function

Friday, 10 March 2017

Java Class EASY MODE

package somePackage;
import java.*;

public class someClass
{
   public someClass()
   {
   //Constructor
   }
   public void someMethod()
   {
   //do stuff
   }
}

Monday, 27 February 2017

Java Access Modifiers

Public, Protected, Default & Private

Polymorphism

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


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

Monday, 16 January 2017

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.

Sunday, 8 January 2017

public static final

public static final

public 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.