Skip to content

Instantly share code, notes, and snippets.

View krishnadey30's full-sized avatar

Krishna Kumar Dey krishnadey30

View GitHub Profile

Inheritance in Java:

Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. When you inherit from an existing class, you can reuse methods and fields of the parent class. Moreover, you can add new methods and fields in your current class also.

Why use inheritance in java

  • For Method Overriding (so runtime polymorphism can be achieved).
  • For Code Reusability.

The syntax of Java Inheritance

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krishnadey30
krishnadey30 / Unit Test Frameworks.md
Last active May 22, 2019 00:41
This gist hold information about different Unit Test Framework.

Unit Test Frameworks

  • Julia
  • Go
  • D

Julia's Unit Testing

@krishnadey30
krishnadey30 / FeatureRequest_Issues.md
Last active May 22, 2019 21:27
This gist holds a draft of the feature request for the Unit Test Framework CHAPEL-LANG.

Proposed support for Reflection functions that get name of method of a class.

Issue #13068

I believe it will be very useful if, especially for the unit test framework if it were possible to get the name of method present in a class as a string. This will be helpful to check if the method is a test method or not.

/* Get the type of the ith method in a class.
   Causes a compilation error if `i` is not in 1..numMethods(t).
   :arg t: a class type
 :arg i: which method to get the name of
@krishnadey30
krishnadey30 / assertFunctions.md
Last active May 30, 2019 15:00
Code for assert Functions
module UnitTest {
  use Reflection;
  /*
    Assert that a boolean condition is true.  If it is false, prints
    'assert failed' and halts the program.

    :arg test: the boolean condition
    :type test: `bool`
  */
@krishnadey30
krishnadey30 / UnitTest.md
Last active June 17, 2019 23:11
This gist contains the initial draft of the UnitTest Framework - Chapel
module UnitTest {
  use Reflection;
  use TestError;

  config const skipId: int = 0;
  // This is a dummy test so that we get capture the function signature
  private
  proc testSignature(test: Test) throws { }
  var tempFcf = testSignature;
@krishnadey30
krishnadey30 / TestResult.md
Last active June 17, 2019 23:07
This gist holds the initial draft of TestResult class for Chapel's UnitTest Framework.
/*
  Holder for test result information.
  Test results are automatically managed by the TestRunner, and do not 
  need to be explicitly manipulated by writers of tests.  
  Each instance holds the total number of tests run, and collections of 
  failures and errors that occurred among those test runs. The collections
  contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
  formatted traceback of the error that occurred.
*/
@krishnadey30
krishnadey30 / launcher.md
Last active June 17, 2019 23:09
This Gist holds the initial draft of Test Launcher of Unit Test Framework(Chapel) which be used with mason
/*
  This launcher will be used to run the test files and catch the halts.
  You can specify a different directory name using the `--dir` 
  You can set whether or not to descend recursively into 
  subdirectories (defaults to true) using `--subdir`
*/
use FileSystem;
use Spawn;
use Path;
@krishnadey30
krishnadey30 / GSoC_2019UnitTestFramework.md
Last active January 6, 2022 05:59
GSoC 2019 Unit Test Framework