Is there a way to require a subclass to call super explicitly in it's constructor?

Member Avatar
Member Avatar
+0 forum 4

How can I terminate resources in a safe way when JFrame is about to close? - If I put terminate() in the a finally block it runs before windowClosing(). - If I put terminate in windowClosing() it can't be accessed from an inner class. I am aware that I shouldn't use finalize(), but I don't know from where (and how) should I call my terminate() method. Is there an "official" way to **close a JFrame with windowClosing() and do some tasks** (save data, close streams) **before** the program **exits**? **Where should I put my terminate() method?** public class Test extends …

Member Avatar
Member Avatar
+0 forum 2

Hi, I found the examples of explicit specialization, but I have a vagueness about code: using namespace std; template<class T = float, int i = 5> class A { public: A(); int value; }; template<> class A<> { public: A(); }; template<> class A<double, 10> { public: A(); }; template<class T, int i> A<T, i>::A() : value(i) { cout << "Primary template, " << "non-type argument is " << value << endl; } A<>::A() { cout << "Explicit specialization " << "default arguments" << endl; } A<double, 10>::A() { cout << "Explicit specialization " << "<double, 10>" << endl; } …

Member Avatar
Member Avatar
+0 forum 2

Hello Guys, Well i have a problem, I coded a program to print the ascii table, then give the user a option to either convert character into ascii or ASCII to character. Well the latter is not working, and the loop to print the ascii table is having the same trouble. Well I did that loop earlier, but there i used the characters as it is, having to make the loop little Inefficient. Here i want it to be done in this way... But Explicit conversion of int to char is causing the trouble.... Please help me out... Here is …

Member Avatar
Member Avatar
+0 forum 14

The End.