WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

abstract class constructors | Loop and Break

abstract class constructors

The superclass Product is abstract and has a constructor. The concrete class TimesTwo has a default constructor that just hardcodes the value 2. The concrete class TimesWhat has a constructor that allows the caller to specify the value.
 
NOTE: As there is no default (or no-arg) constructor in the parent abstract class the constructor used in subclasses must be specified.
Abstract constructors will frequently be used to enforce class constraints or invariants such as the minimum fields required to setup the class.

Example

abstract class Product {
	int multiplyBy;

	public Product(int multiplyBy) {
		this.multiplyBy = multiplyBy;
	}

	public int mutiply(int val) {
		return multiplyBy * val;
	}
}

class TimesTwo extends Product {
	public TimesTwo() {
		super(2);
	}
}

public class TimesWhat extends Product {
	public TimesWhat(int what) {
		super(what);
	}

	public static void main(String[] args) {
		TimesTwo t2 = new TimesTwo();
		int a = t2.mutiply(4);
		System.out.println("Times Two " + a);

		TimesWhat t3 = new TimesWhat(3);
		int b = t3.mutiply(4);
		System.out.println("Times what " + b);
	}
}

Output

Times Two 8
Times what 12
Share

You may also like...