{"id":2339,"date":"2022-06-04T13:49:18","date_gmt":"2022-06-04T08:19:18","guid":{"rendered":"https:\/\/codequotient.com\/blog\/?p=2339"},"modified":"2024-02-14T17:31:25","modified_gmt":"2024-02-14T12:01:25","slug":"java-programs-interview-freshers","status":"publish","type":"post","link":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/","title":{"rendered":"Top 8 Java Programs for Interview"},"content":{"rendered":"<p>The IT industry is actively expanding, and almost every company is looking for candidates to fill open positions. Java is perhaps one of the most widely used programming languages today. Understanding the Java programs for interview is critical for anyone looking to break into the IT industry. Because of its popularity, it is one of the most sought-after programming languages in the IT industry.<\/p>\n<p>Java is a general-purpose language that supports both object-oriented and procedural programming styles. It has been around since 1995 and is one of the first object-oriented programming languages to be created.<\/p>\n<p>However, the language is used to develop a wide variety of applications and is important for businesses, government agencies, schools, and anyone who wants to create an app.<\/p>\n<p>As a fresher, you might wonder what kind of Java programs interview questions you will be asked to write in an interview. While the specific programs will vary depending on the company and position you are interviewing for, here are some commonly asked general categories.<\/p>\n<h2><b>How To Prepare For a Java Programs Interview<\/b><\/h2>\n<p>A Java interview can be a daunting experience. However, if you are well-prepared, you can ace the interview and land the job. To prepare for a Java interview, you should first learn the basics of the language.<\/p>\n<p>Next, you should practice answering common interview questions.<\/p>\n<p>Finally, you should familiarise yourself with the company&#8217;s culture and expectations. Following these steps can increase your chances of landing the job you want.<\/p>\n<p>Here are the top 8 Java programs asked about in interviews:<\/p>\n<h2><b>Top 8 Java Programs Asked In Interview for Freshers With Solution<\/b><\/h2>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-2340\" src=\"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers-With-Solution.jpg\" alt=\"Top-8-Java-Programs-Asked-In-Interview-for-Freshers-With-Solution\" width=\"1480\" height=\"774\" \/><\/p>\n<p>Prepare yourself for the interview process with these commonly asked questions from past interviews:<\/p>\n<h3><b>1. The Fibonacci series<\/b><\/h3>\n<p>This is a very commonly asked Java programs interview question. Starting with 0 and 1, the Fibonacci series is a series of elements in which the previous two elements are added to get the next element.<\/p>\n<p>Any number of integers from the Fibonacci series can be displayed using this programme. Each number in the Fibonacci sequence equals the sum of the two numbers before it.<\/p>\n<p>For the above method, here is a Java programme:<\/p>\n<p>class GFG {<\/p>\n<p>\/\/ Function to print N Fibonacci Number<\/p>\n<p>static void Fibonacci(int N)<\/p>\n<p>{<\/p>\n<p>int num1 = 0, num2 = 1;<\/p>\n<p>int counter = 0;<\/p>\n<p>\/\/ Iterate till counter is N<\/p>\n<p>while (counter &lt; N) {<\/p>\n<p>\/\/ Print the number<\/p>\n<p>System.out.print(num1 + &#8221; &#8220;);<\/p>\n<p>\/\/ Swap<\/p>\n<p>int num3 = num2 + num1;<\/p>\n<p>num1 = num2;<\/p>\n<p>num2 = num3;<\/p>\n<p>counter = counter + 1;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\/\/ Driver Code<\/p>\n<p>public static void main(String args[])<\/p>\n<p>{<\/p>\n<p>\/\/ Given Number N<\/p>\n<p>int N = 10;<\/p>\n<p>\/\/ Function Call<\/p>\n<p>Fibonacci(N);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p><b><i>Also Read: <\/i><\/b><a href=\"https:\/\/codequotient.com\/blog\/c-questions-know-tech-interviews\/\"><b><i>Common C++ Questions to Know for Tech Interviews<\/i><\/b><\/a><\/p>\n<h3><b>2. Checking for prime number<\/b><\/h3>\n<p>You will be expected to write a programme to determine whether a given number is prime or composite. A prime number is greater than 1 and can only be divided by 1 or itself.<\/p>\n<p>For instance, Prime numbers include 2, 3, 5, 7, 11, 13, and 17. We&#8217;ll take a number variable and verify whether it&#8217;s prime or not in this Java programme. Let&#8217;s look at a Java prime number programme:<\/p>\n<p>public class PrimeExample{<\/p>\n<p>public static void main(String args[]){<\/p>\n<p>int i,m=0,flag=0;<\/p>\n<p>int n=3;\/\/it is the number to be checked<\/p>\n<p>m=n\/2;<\/p>\n<p>if(n==0||n==1){<\/p>\n<p>System.out.println(n+&#8221; is not prime number&#8221;);<\/p>\n<p>}else{<\/p>\n<p>for(i=2;i&lt;=m;i++){<\/p>\n<p>if(n%i==0){<\/p>\n<p>System.out.println(n+&#8221; is not prime number&#8221;);<\/p>\n<p>flag=1;<\/p>\n<p>break;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>if(flag==0)\u00a0 { System.out.println(n+&#8221; is prime number&#8221;); }<\/p>\n<p>}\/\/end of else<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>After you run the above code, you\u2019d receive the number 3 as Output (prime number).<\/p>\n<h3><b>3. String palindrome<\/b><\/h3>\n<p>It is a program that determines whether or not a given string is a palindrome. A palindrome is a string, which, when read forward and backward, means the same. Although to check whether or not a string is a palindrome, a string needs to be compared with its reverse.<\/p>\n<p>So let us consider two strings, \u201c12121\u201d and \u201capple\u201d, now the task is to find out if its reverse string is the same as it is.<\/p>\n<p>package org.arpit.java2blog;<\/p>\n<p>import java.util.Scanner;<\/p>\n<p>public class StringFullLoopPalindrome {<\/p>\n<p>public static void main(String[] args) {<\/p>\n<p>Scanner scanner = new Scanner(System.in);<\/p>\n<p>System.out.print(&#8220;Enter string : &#8220;);<\/p>\n<p>String str = scanner.nextLine();<\/p>\n<p>String reverseStr = &#8220;&#8221;;<\/p>\n<p>for(int i = str.length() &#8211; 1; i &gt;= 0; i&#8211;){<\/p>\n<p>reverseStr = reverseStr + str.charAt(i);<\/p>\n<p>}<\/p>\n<p>if(str.equals(reverseStr)){<\/p>\n<p>System.out.println(&#8220;String is palindrome&#8221;);<\/p>\n<p>} else {<\/p>\n<p>System.out.println(&#8220;String is not palindrome&#8221;);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>When you run the above program, you will get below output:<\/p>\n<p>Enter string : 12121<\/p>\n<p>String is palindrome<\/p>\n<p>Enter a string: Apple<\/p>\n<p>String is not a palindrome<\/p>\n<h3><b>4. Bubble sort\u00a0<\/b><\/h3>\n<p>You may be asked to write a code snippet to implement bubble sort. Bubble Sort is the most basic sorting algorithm, and it works by repeatedly swapping adjacent elements if they are out of order. However, because of its average and worst-case time complexity, this algorithm is unsuitable for large data sets.<\/p>\n<p>In each iteration, each element of the array moves to the end of the array, similar to how air bubbles rise to the water\u2019s surface. That\u2019s why it&#8217;s referred to as a bubble sort.<\/p>\n<p>The code below is the solution to a common Java interview question about bubble sort:<\/p>\n<p>\/\/ Bubble sort in Java<\/p>\n<p>import java.util.Arrays;<\/p>\n<p>class Main {<\/p>\n<p>\/\/ perform the bubble sort<\/p>\n<p>static void bubbleSort(int array[]) {<\/p>\n<p>int size = array.length;<\/p>\n<p>\/\/ loop to access each array element<\/p>\n<p>for (int i = 0; i &lt; size &#8211; 1; i++)<\/p>\n<p>\/\/ loop to compare array elements<\/p>\n<p>for (int j = 0; j &lt; size &#8211; i &#8211; 1; j++)<\/p>\n<p>\/\/ compare two adjacent elements<\/p>\n<p>\/\/ change &gt; to &lt; to sort in descending order<\/p>\n<p>if (array[j] &gt; array[j + 1]) {<\/p>\n<p>\/\/ swapping occurs if elements<\/p>\n<p>\/\/ are not in the intended order<\/p>\n<p>int temp = array[j];<\/p>\n<p>array[j] = array[j + 1];<\/p>\n<p>array[j + 1] = temp;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>public static void main(String args[]) {<\/p>\n<p>int[] data = { -2, 45, 0, 11, -9 };<\/p>\n<p>\/\/ call method using class name<\/p>\n<p>Main.bubbleSort(data);<\/p>\n<p>System.out.println(&#8220;Sorted Array in Ascending Order:&#8221;);<\/p>\n<p>System.out.println(Arrays.toString(data));<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<h3><b>5. Armstrong number<\/b><\/h3>\n<p>An Armstrong number is simply the sum of the cubes of its digits. This is a Java programme to verify whether or not a given number is an Armstrong number.<\/p>\n<p>As an input, you need to enter the integer to be checked. Then, you can use modulos and division operations, loops and if-else statements to get the output.<\/p>\n<p>Here is the Java source code for checking if a given number is an Armstrong number. The output of the programme is also shown below.<\/p>\n<p>import java.util.Scanner;<\/p>\n<p>public class ArmStrong<\/p>\n<p>{<\/p>\n<p>public static void main(String[] args)<\/p>\n<p>{<\/p>\n<p>int n, count = 0, a, b, c, sum = 0;<\/p>\n<p>Scanner s = new Scanner(System.in);<\/p>\n<p>System.out.print(&#8220;Enter any integer you want to check:&#8221;);<\/p>\n<p>n = s.nextInt();<\/p>\n<p>a = n;<\/p>\n<p>c = n;<\/p>\n<p>while(a &gt; 0)<\/p>\n<p>{<\/p>\n<p>a = a \/ 10;<\/p>\n<p>count++;<\/p>\n<p>}<\/p>\n<p>while(n &gt; 0)<\/p>\n<p>{<\/p>\n<p>b = n % 10;<\/p>\n<p>sum = (int) (sum+Math.pow(b, count));<\/p>\n<p>n = n \/ 10;<\/p>\n<p>}<\/p>\n<p>if(sum == c)<\/p>\n<p>{<\/p>\n<p>System.out.println(&#8220;Given number is Armstrong&#8221;);<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p>System.out.println(&#8220;Given number is not Armstrong&#8221;);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Output:<\/p>\n<p>$ javac ArmStrong.java<\/p>\n<p>$ java ArmStrong<\/p>\n<p>Enter any integer to be checked: 153<\/p>\n<p>The given number is Armstrong.<\/p>\n<p><b><i>Also Read: <\/i><\/b><a href=\"https:\/\/codequotient.com\/blog\/java-programming-questions-interview\/\"><b><i>10 Tricky Java Programming Questions to Ace Your Interview<\/i><\/b><\/a><\/p>\n<h3><b>6. Merge Sort<\/b><\/h3>\n<p>Merge Sort is one of the most effective sorting algorithms, operating on the divide-and-conquer principle. It is built on the notion of breaking down a list into several sub-lists, each of which contains a single element. Then merge those sublists in a way that produces a sorted list.<\/p>\n<p>Here\u2019s the code example to Merge Sort:<\/p>\n<p>public class MergeSort {<\/p>\n<p>public static void main(String[] args) {<\/p>\n<p>int[] arr = { 70, 50, 30, 10, 20, 40, 60 };<\/p>\n<p>int[] merged = mergeSort(arr, 0, arr.length &#8211; 1);<\/p>\n<p>for (int val : merged) {<\/p>\n<p>System.out.print(val + &#8221; &#8220;);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>public static int[] mergeTwoSortedArrays(int[] one, int[] two) {<\/p>\n<p>int[] sorted = new int[one.length + two.length];<\/p>\n<p>int i = 0;<\/p>\n<p>int j = 0;<\/p>\n<p>int k = 0;<\/p>\n<p>while (i &lt; one.length &amp;&amp; j &lt; two.length) {<\/p>\n<p>if (one[i] &lt; two[j]) {<\/p>\n<p>sorted[k] = one[i];<\/p>\n<p>k++;<\/p>\n<p>i++;<\/p>\n<p>} else {<\/p>\n<p>sorted[k] = two[j];<\/p>\n<p>k++;<\/p>\n<p>j++;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>if (i == one.length) {<\/p>\n<p>while (j &lt; two.length) {<\/p>\n<p>sorted[k] = two[j];<\/p>\n<p>k++;<\/p>\n<p>j++;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>if (j == two.length) {<\/p>\n<p>while (i &lt; one.length) {<\/p>\n<p>sorted[k] = one[i];<\/p>\n<p>k++;<\/p>\n<p>i++;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>return sorted;<\/p>\n<p>}<\/p>\n<p>public static int[] mergeSort(int[] arr, int lo, int hi) {<\/p>\n<p>if (lo == hi) {<\/p>\n<p>int[] br = new int[1];<\/p>\n<p>br[0] = arr[lo];<\/p>\n<p>return br;<\/p>\n<p>}<\/p>\n<p>int mid = (lo + hi) \/ 2;<\/p>\n<p>int[] fh = mergeSort(arr, lo, mid);<\/p>\n<p>int[] sh = mergeSort(arr, mid + 1, hi);<\/p>\n<p>int[] merged = mergeTwoSortedArrays(fh, sh);<\/p>\n<p>return merged;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<h3><b>7. Factorial<\/b><\/h3>\n<p>Factorial is one of the simplest and most popular Java programs and is commonly asked in Java interviews and other programming languages such as C or C++. For example, the interviewer may examine converting a recursive solution to an iterative one or vice versa.<\/p>\n<p>The factorial of a number is calculated using the formula number*(number -1) until zero. Because the value of factorial zero is 1, it serves as the base case in the recursive version of the factorial method.<\/p>\n<p>Also, let&#8217;s look at a complete code example of a Java programme that calculates a number&#8217;s factorial in both recursive and iterative ways.<\/p>\n<p>However, if you look closely, you will notice that the recursive solution to calculating factorial is much easier to write and read because it represents the formula number* (number -1).<\/p>\n<p>Here&#8217;s an example of a Java programme for calculating a number&#8217;s factorial:<\/p>\n<p>\/**<\/p>\n<p>* Simple Java program to find the factorial of a number using recursion and iteration.<\/p>\n<p>* Iteration will use for loop while recursion will call method itself<\/p>\n<p>*\/<\/p>\n<p>public class FactorialInJava{<\/p>\n<p>public static void main(String args[]) {<\/p>\n<p>\/\/finding factorial of a number in Java using recursion &#8211; Example<\/p>\n<p>System.out.println(&#8220;factorial of 5 using recursion in Java is: &#8221; + factorial(5));<\/p>\n<p>\/\/finding factorial of a number in Java using Iteration &#8211; Example<\/p>\n<p>System.out.println(&#8220;factorial of 6 using iteration in Java is: &#8221; + fact(6));<\/p>\n<p>}<\/p>\n<p>\/*<\/p>\n<p>* Java program example to find factorial of a number using recursion<\/p>\n<p>* @return factorial of a number<\/p>\n<p>*\/<\/p>\n<p>public static int factorial(int number){<\/p>\n<p>\/\/base case<\/p>\n<p>if(number == 0){<\/p>\n<p>return 1;<\/p>\n<p>}<\/p>\n<p>return number*factorial(number -1); \/\/is this tail-recursion?<\/p>\n<p>}<\/p>\n<p>\/*<\/p>\n<p>* Java program example to calculate factorial using while loop or iteration<\/p>\n<p>* @return factorial of a number<\/p>\n<p>*\/<\/p>\n<p>public static int fact(int number){<\/p>\n<p>int result = 1;<\/p>\n<p>while(number != 0){<\/p>\n<p>result = result*number;<\/p>\n<p>number&#8211;;<\/p>\n<p>}<\/p>\n<p>return result;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>When you run the above program and you will get the below output:<\/p>\n<ul>\n<li>The factorial of 5 using recursion in Java is 120.<\/li>\n<li>Also, the factorial of 6 using iteration in Java is 720.<\/li>\n<\/ul>\n<h3><b>8. Reversing strings<\/b><\/h3>\n<p>Strings are character sequences in Java. They are one of Java&#8217;s most popular data structures. While programming, you may be required to reverse a string in Java.<\/p>\n<p>Consider a crossword puzzle: the answer to the clue is nothing but a string, and the letters that make up the answer are characters.<\/p>\n<p>There are different ways to reverse a string in Java, and we\u2019ll look at the most common method &#8211; By using toCharArray()<\/p>\n<p>The toCharArray() function is one way to reverse a string in Java.<\/p>\n<p>public static String reverse(String str) {<\/p>\n<p>String rev = &#8220;&#8221;;<\/p>\n<p>char[] finalarray = str.toCharArray();<\/p>\n<p>for (int i = finalarray.length &#8211; 1; i &gt;= 0; i&#8211;)<\/p>\n<p>rev += finalarray[i];<\/p>\n<p>return rev;<\/p>\n<p>}<\/p>\n<p>\/\/Sample Input- &#8220;Scaler Academy&#8221;<\/p>\n<p>\/\/Sample Output-&#8220;ymedacA relacS&#8221;<\/p>\n<p><b><i>Also Read:<\/i><\/b><a href=\"https:\/\/codequotient.com\/blog\/cognizant-genc-next-coding-questions\/\"><b><i> Critical Tips To Ace Cognizant Genc Next Coding Questions For Freshers<\/i><\/b><\/a><\/p>\n<h2>Final Thoughts<\/h2>\n<p>So, we&#8217;ve covered the top 8 Java Programs interview questions for Freshers in this article. You can also find various questions from other sources. The key to success in the Java interview is to answer as many questions as possible. The more programs you can code, the better your chances of getting through the interview.<\/p>\n<p>Being certified also gives you an advantage during the interview. So, if you haven&#8217;t already validated your Java expertise, we recommend checking out <a href=\"https:\/\/codequotient.com\/\">CodeQuotient\u2019s<\/a> SuperCoders Internship Program. You can thoroughly master all the concepts in this program while earning a placement! <a href=\"https:\/\/codequotient.com\/supercoders-program\">Apply today<\/a> for a successful career in the tech industry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The IT industry is actively expanding, and almost every company is looking for candidates to fill open positions. Java is perhaps one of the most widely used programming languages today. Understanding the Java programs for interview is critical for anyone looking to break into the IT industry. Because of its popularity, it is one of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2341,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[131],"tags":[70,137,15,29,26,21,25,30],"class_list":{"0":"post-2339","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-software-engineering-bootcamp","8":"tag-coding-assessment","9":"tag-coding-exams","10":"tag-coding-jobs","11":"tag-developer","12":"tag-tech-hiring","13":"tag-tech-interviews","14":"tag-tech-recruitment","15":"tag-training","16":"nt-post-class","17":"","20":"excerpt-none"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Top 8 Java Programs for Interview - CodeQuotient<\/title>\n<meta name=\"description\" content=\"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 8 Java Programs for Interview - CodeQuotient\" \/>\n<meta property=\"og:description\" content=\"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeQuotient\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codequotient\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-04T08:19:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-14T12:01:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1480\" \/>\n\t<meta property=\"og:image:height\" content=\"774\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Team CodeQuotient\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codequotient\" \/>\n<meta name=\"twitter:site\" content=\"@codequotient\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team CodeQuotient\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/\"},\"author\":{\"name\":\"Team CodeQuotient\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#\\\/schema\\\/person\\\/d84614276ce2ccc8578c447a515c02f8\"},\"headline\":\"Top 8 Java Programs for Interview\",\"datePublished\":\"2022-06-04T08:19:18+00:00\",\"dateModified\":\"2024-02-14T12:01:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/\"},\"wordCount\":1946,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg\",\"keywords\":[\"Coding Assessment\",\"Coding Exams\",\"Coding Jobs\",\"Developer\",\"Tech Hiring\",\"Tech Interviews\",\"Tech Recruitment\",\"Training\"],\"articleSection\":[\"Software Engineering Bootcamp\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/\",\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/\",\"name\":\"Top 8 Java Programs for Interview - CodeQuotient\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg\",\"datePublished\":\"2022-06-04T08:19:18+00:00\",\"dateModified\":\"2024-02-14T12:01:25+00:00\",\"description\":\"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg\",\"contentUrl\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg\",\"width\":1480,\"height\":774,\"caption\":\"Top-8-Java-Programs-Asked-In-Interview-for-Freshers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/java-programs-interview-freshers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Top 8 Java Programs for Interview\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/\",\"name\":\"CodeQuotient\",\"description\":\"Resources to be a better programmer\",\"publisher\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#organization\",\"name\":\"CodeQuotient\",\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/codequotient-logo.png\",\"contentUrl\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/codequotient-logo.png\",\"width\":238,\"height\":104,\"caption\":\"CodeQuotient\"},\"image\":{\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codequotient\",\"https:\\\/\\\/x.com\\\/codequotient\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codequotient\",\"https:\\\/\\\/www.instagram.com\\\/codequotient\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/#\\\/schema\\\/person\\\/d84614276ce2ccc8578c447a515c02f8\",\"name\":\"Team CodeQuotient\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g\",\"caption\":\"Team CodeQuotient\"},\"sameAs\":[\"https:\\\/\\\/blog.codequotient.com\"],\"url\":\"https:\\\/\\\/codequotient.com\\\/blog\\\/author\\\/codequotient\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 8 Java Programs for Interview - CodeQuotient","description":"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.","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:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/","og_locale":"en_GB","og_type":"article","og_title":"Top 8 Java Programs for Interview - CodeQuotient","og_description":"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.","og_url":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/","og_site_name":"CodeQuotient","article_publisher":"https:\/\/www.facebook.com\/codequotient","article_published_time":"2022-06-04T08:19:18+00:00","article_modified_time":"2024-02-14T12:01:25+00:00","og_image":[{"width":1480,"height":774,"url":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","type":"image\/jpeg"}],"author":"Team CodeQuotient","twitter_card":"summary_large_image","twitter_creator":"@codequotient","twitter_site":"@codequotient","twitter_misc":{"Written by":"Team CodeQuotient","Estimated reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#article","isPartOf":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/"},"author":{"name":"Team CodeQuotient","@id":"https:\/\/codequotient.com\/blog\/#\/schema\/person\/d84614276ce2ccc8578c447a515c02f8"},"headline":"Top 8 Java Programs for Interview","datePublished":"2022-06-04T08:19:18+00:00","dateModified":"2024-02-14T12:01:25+00:00","mainEntityOfPage":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/"},"wordCount":1946,"commentCount":0,"publisher":{"@id":"https:\/\/codequotient.com\/blog\/#organization"},"image":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#primaryimage"},"thumbnailUrl":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","keywords":["Coding Assessment","Coding Exams","Coding Jobs","Developer","Tech Hiring","Tech Interviews","Tech Recruitment","Training"],"articleSection":["Software Engineering Bootcamp"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/","url":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/","name":"Top 8 Java Programs for Interview - CodeQuotient","isPartOf":{"@id":"https:\/\/codequotient.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#primaryimage"},"image":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#primaryimage"},"thumbnailUrl":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","datePublished":"2022-06-04T08:19:18+00:00","dateModified":"2024-02-14T12:01:25+00:00","description":"Top 8 Java Programs for Interview in this page. You will learn the fundamentals of programming and you will also get an insight into the Java programming language.","breadcrumb":{"@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#primaryimage","url":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","contentUrl":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","width":1480,"height":774,"caption":"Top-8-Java-Programs-Asked-In-Interview-for-Freshers"},{"@type":"BreadcrumbList","@id":"https:\/\/codequotient.com\/blog\/java-programs-interview-freshers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codequotient.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Top 8 Java Programs for Interview"}]},{"@type":"WebSite","@id":"https:\/\/codequotient.com\/blog\/#website","url":"https:\/\/codequotient.com\/blog\/","name":"CodeQuotient","description":"Resources to be a better programmer","publisher":{"@id":"https:\/\/codequotient.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codequotient.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/codequotient.com\/blog\/#organization","name":"CodeQuotient","url":"https:\/\/codequotient.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/codequotient.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2020\/12\/codequotient-logo.png","contentUrl":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2020\/12\/codequotient-logo.png","width":238,"height":104,"caption":"CodeQuotient"},"image":{"@id":"https:\/\/codequotient.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codequotient","https:\/\/x.com\/codequotient","https:\/\/www.linkedin.com\/company\/codequotient","https:\/\/www.instagram.com\/codequotient\/"]},{"@type":"Person","@id":"https:\/\/codequotient.com\/blog\/#\/schema\/person\/d84614276ce2ccc8578c447a515c02f8","name":"Team CodeQuotient","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/612e6d66a89f62c087fb5a3e21cc59e53d1478a67562e8d08ec755a92ada292b?s=96&d=mm&r=g","caption":"Team CodeQuotient"},"sameAs":["https:\/\/blog.codequotient.com"],"url":"https:\/\/codequotient.com\/blog\/author\/codequotient\/"}]}},"featured_image_src":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","featured_image_src_square":"https:\/\/codequotient.com\/blog\/wp-content\/uploads\/2022\/06\/Top-8-Java-Programs-Asked-In-Interview-for-Freshers.jpg","author_info":{"display_name":"Team CodeQuotient","author_link":"https:\/\/codequotient.com\/blog\/author\/codequotient\/"},"_links":{"self":[{"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/posts\/2339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/comments?post=2339"}],"version-history":[{"count":3,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/posts\/2339\/revisions"}],"predecessor-version":[{"id":2807,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/posts\/2339\/revisions\/2807"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/media\/2341"}],"wp:attachment":[{"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/media?parent=2339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/categories?post=2339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codequotient.com\/blog\/wp-json\/wp\/v2\/tags?post=2339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}