{"id":42638,"date":"2021-12-07T17:48:55","date_gmt":"2021-12-07T17:48:55","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=42638"},"modified":"2021-12-07T17:48:57","modified_gmt":"2021-12-07T17:48:57","slug":"comp-sci-type-parameter","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-type-parameter\/","title":{"rendered":"Comp sci: type parameter"},"content":{"rendered":"\n<h2>Tutoring computer science, terms are important. The tutor mentions <em>type parameter<\/em>.<\/h2>\n<p>\nThe motivation for a <em>type parameter<\/em> is easiest to imagine with a strongly typed language like Java. Typically, such a language insists on knowing the type of an argument before it receives it.<\/p>\n<p>\nYet, sometimes, a method will be defined to handle input of unspecified type. Then, an angle bracketed expression such as &lt;T&gt; will be in the method signature, meaning it can accept arbitrary types.<\/p>\n<p>\nInternally, the method may use &#8220;if&#8221; conditions to determine how to handle the input, according to its type. Depending on the language, other ways, such as redirecting the input to a specific method based on the type it&#8217;s discovered to be, may also be used.<\/p>\n<p>The word <em>generic<\/em> is typically used to refer to classes, methods, or functions whose definitions include type parameters. <em>Generic<\/em> may also refer to the inputs, unknown presently, that will be passed to the code.<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/www.tutorialspoint.com\/java\/java_generics.htm\">tutorialspoint.com<\/a><\/p>\n<p>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/generics\/generic-type-parameters\">docs.microsoft.com<\/a><\/p>\n<p><a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/java\/generics\/types.html\">docs.oracle.com<\/a><\/p>\n<p><a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0443\/\">python.org<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Tutoring computer science, terms are important. The tutor mentions type parameter. The motivation for a type parameter is easiest to imagine with a strongly typed language like Java. Typically, such a language insists on knowing the type of an argument &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-type-parameter\/\"> <span class=\"screen-reader-text\">Comp sci: type parameter<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-42638","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=42638"}],"version-history":[{"count":11,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42638\/revisions"}],"predecessor-version":[{"id":42649,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42638\/revisions\/42649"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=42638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=42638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=42638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}