{"id":668,"date":"2021-07-14T00:03:30","date_gmt":"2021-07-14T00:03:30","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=668"},"modified":"2021-09-11T10:40:24","modified_gmt":"2021-09-11T10:40:24","slug":"java-program-to-find-second-largest-number-in-an-array","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/","title":{"rendered":"Java program to find second largest number in an array ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"java-program-to-find-second-largest-number-in-an-array\" class=\"color-pink\" style=\"text-align: justify;\">Java program to find second largest number in an array ?<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Given an\u00a0<a href=\"https:\/\/www.wikitechy.com\/technology\/find-closest-pair-two-sorted-arrays\/\" target=\"_blank\" rel=\"noopener\">array<\/a>\u00a0of integers, our task is to write a program that efficiently finds the second\u00a0<a href=\"https:\/\/www.wikitechy.com\/technology\/c-programming-kth-smallestlargest-element-unsorted-array-expected-linear-time-2\/\" target=\"_blank\" rel=\"noopener\">largest element<\/a>\u00a0present in the array.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"algorithm\" class=\"color-red\">Algorithm:<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Initialize two variables first and second to INT_MIN as,\n<ul>\n<li>first = second = INT_MIN<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Start\u00a0<a href=\"https:\/\/www.wikitechy.com\/technology\/c-programming-tree-traversals-inorder-preorder-postorder\/\" target=\"_blank\" rel=\"noopener\">traversing the array<\/a>,<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>a) If the current element in array say arr[i] is greater than first. Then update first and second as,<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>second = first<\/li>\n<li>first = arr[i]<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>b) If the current element is in between first and second, then update second to store the value of current variable as<\/p>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>second = arr[i]<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Return the value stored in second.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"step-1\" class=\"color-blue\">step 1<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Iterate the given array.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"step-2-first-if-condition-arri-largest\" class=\"color-blue\">Step 2 (first if condition arr[i] > largest):<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>If current array value is greater than largest value then move the largest value to\u00a0<a href=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-find-second-largest-element-in-bst\/\" target=\"_blank\" rel=\"noopener\">secondLargest<\/a>\u00a0and make current value as largest<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"step-3-second-if-condition-arri-secondlargest\" class=\"color-blue\">Step 3 (second if condition arr[i] >secondLargest )<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>If the current value is smaller than largest and greater than secondLargest then the current value becomes secondLargest.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"sample-code-in-java\" class=\"color-red\" style=\"text-align: justify;\">Sample code in Java<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-java code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-java code-embed-code\">public class SecondLargest {<br\/>     <br\/>    \tpublic static void main(String[] args) {<br\/>     <br\/>    \t\tint arr[] = { 24, 56, 57, 105, 102, 62, 58, 46, 76, 95 };<br\/>    \t\tint largest = arr[0];<br\/>    \t\tint secondLargest = arr[0];<br\/>    \t\t<br\/>    \t\tSystem.out.println(&quot;The given array is:&quot; );<br\/>    \t\tfor (int i = 0; i < arr.length; i++) {<br\/>    \t\t\tSystem.out.print(arr[i]+&quot;\\t&quot;);<br\/>    \t\t}<br\/>    \t\tfor (int i = 0; i < arr.length; i++) {<br\/>     <br\/>    \t\t\tif (arr[i] > largest) {<br\/>    \t\t\t\tsecondLargest = largest;<br\/>    \t\t\t\tlargest = arr[i];<br\/>     <br\/>    \t\t\t} else if (arr[i] > secondLargest) {<br\/>    \t\t\t\tsecondLargest = arr[i];<br\/>     <br\/>    \t\t\t}<br\/>    \t\t}<br\/>     <br\/>    \t\tSystem.out.println(&quot;\\nSecond largest number is:&quot; + secondLargest);<br\/>     <br\/>    \t}<br\/>    }<\/code><\/pre> <\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"output\" class=\"color-red\">Output<\/h2>\n<\/div>\n<\/div>\n<div class=\"Output\">\n<div class=\"hddn\">\n<figure class=\"highlight\" style=\"text-align: justify;\">\n<pre><code class=\"hljs css\" data-lang=\"\"><span class=\"nt\"><span class=\"hljs-tag\">The<\/span> <span class=\"hljs-tag\">given<\/span> <span class=\"hljs-tag\">array<\/span> <span class=\"hljs-tag\">is<\/span>:\r\n24\t56\t57\t105\t 102  62  58  46  76  95\t\r\n<span class=\"hljs-tag\">Second<\/span> <span class=\"hljs-tag\">largest<\/span> <span class=\"hljs-tag\">number<\/span> <span class=\"hljs-tag\">is<\/span><span class=\"hljs-pseudo\">:102<\/span><\/span><\/code><\/pre>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : Given an array of integers, our task is to write a program&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4004],"tags":[195,491,360,203,199,214,198,363,209,205,4340,2206,2194,2205,4336,4343,4344,2936,222,4348,196,212,213,4337,2204,4334,4345,4335,4339,4332,4346,4347,286,4338,4333,4341,4342,15930,207,366,204,217,282,4023,483,206,200,197,280,364,968],"class_list":["post-668","post","type-post","status-publish","format-standard","hentry","category-java","tag-accenture-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-atos-interview-questions-and-answers","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-collabera-technologies-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-find-largest-and-smallest-number-in-an-array-in-java","tag-find-largest-number-in-array-in-java","tag-find-largest-number-in-array-java","tag-find-largest-number-in-java","tag-find-second-largest-number-in-array-in-java0","tag-find-the-largest-number-in-an-array-in-java","tag-find-the-largest-number-in-an-array-javascript","tag-fis-global-business-solutions-india-pvt-ltd-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-how-to-find-largest-and-smallest-number-in-java","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-infosys-technologies-interview-questions-and-answers","tag-java-code-to-find-second-largest-number-in-an-array","tag-java-find-largest-number-in-list","tag-java-largest-int","tag-java-program-for-largest-of-three-numbers","tag-java-program-to-find-largest-of-three-numbers","tag-java-program-to-find-largest-of-two-numbers","tag-java-program-to-find-second-largest-number-in-an-array","tag-java-program-to-find-second-largest-number-of-array","tag-java-program-to-find-the-largest-number-in-an-array","tag-lt-infotech-interview-questions-and-answers","tag-largest-and-smallest-java-program","tag-largest-number-in-java","tag-largest-of-3-numbers-in-java","tag-largest-of-4-numbers-using-conditional-operator-in-java","tag-magicbricks-interview-questions-and-answers","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-peoplestrong-interview-questions-and-answers","tag-persistent-systems-interview-questions-and-answers","tag-rbs-india-de-interview-questions-and-answers","tag-reliance-industries-ltd-interview-questions-and-answers","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-unitedhealth-group-interview-questions-and-answers","tag-virtusa-consulting-services-pvt-ltd-interview-questions-and-answers","tag-wells-fargo-interview-questions-and-answers","tag-wipro-infotech-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java program to find second largest number in an array ? - Java<\/title>\n<meta name=\"description\" content=\"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java program to find second largest number in an array ? - Java\" \/>\n<meta property=\"og:description\" content=\"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-14T00:03:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-11T10:40:24+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"Java program to find second largest number in an array ?\",\"datePublished\":\"2021-07-14T00:03:30+00:00\",\"dateModified\":\"2021-09-11T10:40:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/\"},\"wordCount\":357,\"commentCount\":0,\"keywords\":[\"Accenture interview questions and answers\",\"Applied Materials interview questions and answers\",\"Atos interview questions and answers\",\"Capgemini interview questions and answers\",\"CASTING NETWORKS INDIA PVT LIMITED interview questions and answers\",\"CGI Group Inc interview questions and answers\",\"Chetu interview questions and answers\",\"Ciena Corporation interview questions and answers\",\"Collabera Technologies interview questions and answers\",\"Dell International Services India Pvt Ltd interview questions and answers\",\"find largest and smallest number in an array in java\",\"find largest number in array in java\",\"find largest number in array java\",\"find largest number in java\",\"find second largest number in array in java0\",\"find the largest number in an array in java\",\"find the largest number in an array javascript\",\"FIS Global Business Solutions India Pvt Ltd interview questions and answers\",\"Flipkart interview questions and answers\",\"how to find largest and smallest number in java\",\"IBM interview questions and answers\",\"Indecomm Global Services interview questions and answers\",\"Infosys Technologies interview questions and answers\",\"java code to find second largest number in an array\",\"java find largest number in list\",\"java largest int\",\"java program for largest of three numbers\",\"java program to find largest of three numbers\",\"java program to find largest of two numbers\",\"java program to find second largest number in an array\",\"java program to find second largest number of array\",\"java program to find the largest number in an array\",\"L&amp;T Infotech interview questions and answers\",\"largest and smallest java program\",\"largest number in java\",\"largest of 3 numbers in java\",\"largest of 4 numbers using conditional operator in java\",\"MagicBricks Interview Questions and Answers\",\"Mphasis interview questions and answers\",\"NetApp interview questions and answers\",\"Oracle Corporation interview questions and answers\",\"PeopleStrong interview questions and answers\",\"Persistent Systems interview questions and answers\",\"RBS India De interview questions and answers\",\"Reliance Industries Ltd interview questions and answers\",\"SAP Labs India Pvt Ltd interview questions and answers\",\"Tech Mahindra interview questions and answers\",\"UnitedHealth Group interview questions and answers\",\"Virtusa Consulting Services Pvt Ltd interview questions and answers\",\"Wells Fargo interview questions and answers\",\"Wipro Infotech interview questions and answers\"],\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/\",\"name\":\"Java program to find second largest number in an array ? - Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2021-07-14T00:03:30+00:00\",\"dateModified\":\"2021-09-11T10:40:24+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/java\\\/java-program-to-find-second-largest-number-in-an-array\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/editor\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java program to find second largest number in an array ? - Java","description":"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/","og_locale":"en_US","og_type":"article","og_title":"Java program to find second largest number in an array ? - Java","og_description":"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/","og_site_name":"Wikitechy","article_published_time":"2021-07-14T00:03:30+00:00","article_modified_time":"2021-09-11T10:40:24+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"Java program to find second largest number in an array ?","datePublished":"2021-07-14T00:03:30+00:00","dateModified":"2021-09-11T10:40:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/"},"wordCount":357,"commentCount":0,"keywords":["Accenture interview questions and answers","Applied Materials interview questions and answers","Atos interview questions and answers","Capgemini interview questions and answers","CASTING NETWORKS INDIA PVT LIMITED interview questions and answers","CGI Group Inc interview questions and answers","Chetu interview questions and answers","Ciena Corporation interview questions and answers","Collabera Technologies interview questions and answers","Dell International Services India Pvt Ltd interview questions and answers","find largest and smallest number in an array in java","find largest number in array in java","find largest number in array java","find largest number in java","find second largest number in array in java0","find the largest number in an array in java","find the largest number in an array javascript","FIS Global Business Solutions India Pvt Ltd interview questions and answers","Flipkart interview questions and answers","how to find largest and smallest number in java","IBM interview questions and answers","Indecomm Global Services interview questions and answers","Infosys Technologies interview questions and answers","java code to find second largest number in an array","java find largest number in list","java largest int","java program for largest of three numbers","java program to find largest of three numbers","java program to find largest of two numbers","java program to find second largest number in an array","java program to find second largest number of array","java program to find the largest number in an array","L&amp;T Infotech interview questions and answers","largest and smallest java program","largest number in java","largest of 3 numbers in java","largest of 4 numbers using conditional operator in java","MagicBricks Interview Questions and Answers","Mphasis interview questions and answers","NetApp interview questions and answers","Oracle Corporation interview questions and answers","PeopleStrong interview questions and answers","Persistent Systems interview questions and answers","RBS India De interview questions and answers","Reliance Industries Ltd interview questions and answers","SAP Labs India Pvt Ltd interview questions and answers","Tech Mahindra interview questions and answers","UnitedHealth Group interview questions and answers","Virtusa Consulting Services Pvt Ltd interview questions and answers","Wells Fargo interview questions and answers","Wipro Infotech interview questions and answers"],"articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/","name":"Java program to find second largest number in an array ? - Java","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-07-14T00:03:30+00:00","dateModified":"2021-09-11T10:40:24+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Java program to find second largest number in an array ? - Given an array of integers , our task is to write a program that efficiently finds the second largest element present in the array.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/java\/java-program-to-find-second-largest-number-in-an-array\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=668"}],"version-history":[{"count":5,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/668\/revisions"}],"predecessor-version":[{"id":3388,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/668\/revisions\/3388"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}