0% found this document useful (0 votes)
14 views

JAVA - Interview Question - Sheet1

The document contains a comprehensive list of Java programming tasks categorized into Basic, Intermediate, Advanced, and OOPs Concepts Programs. Each task includes specific programming objectives such as calculating areas, handling arrays, and implementing object-oriented principles. The tasks range from simple output statements to complex algorithms and data structures.

Uploaded by

blooddonation018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

JAVA - Interview Question - Sheet1

The document contains a comprehensive list of Java programming tasks categorized into Basic, Intermediate, Advanced, and OOPs Concepts Programs. Each task includes specific programming objectives such as calculating areas, handling arrays, and implementing object-oriented principles. The tasks range from simple output statements to complex algorithms and data structures.

Uploaded by

blooddonation018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

S.No.

, Level Questions

1 Java program to print ‘Hello World!’ on screen.


2 Java program to print the sum of two numbers.
3 Java program that takes two numbers and display the product of two numbers.
4 Java program to print the sum, multiply, subtract, divide and remainder of two numbers.
5 Java program that takes five numbers as input to calculate and print the average of the numbers.
6 Java program to find area of circle.
7 Java Program to find area of rectangle.
8 Java Program to find area of triangle.
9 Java Program to find area of equilateral triangle.
10 Java Program to find area of rhombus.
11 Java Program to find area of parallelogram.
12 Java Program to find area of Prism.
13 Java Program to find volume of sphere.
14 Java Program to find volume of cylinder.
15 Java program to concatenate two strings.
16 Java program to convert all characters in a string to lowercase.
17 Java program to trim a string (remove whitespaces).
18 Java program to get a substring of a given string between two specified positions.
19 Java program to replace all the ‘d’ characters with ‘f’ characters.
20 Java program to sum values of an array.
21 Java program to find the index of an array element.
22 Java program to calculate the average value of array elements.
Basic
23 Java program to test if an array contains a specific value.
24 Java program to find the maximum and minimum value of an array.
25 Java program to take three numbers from the user and print the greatest number.
26 Java program to find the number of days in a month.
27 Java program to test a number is positive or negative.
28 Java Program to accept number of week’s day (1-7) and print name of the day.
29 Java program that takes a year from user and print whether that year is a leap year or not.
30 Java program to input 5 numbers from keyboard and find their sum and average.
31 Java program to display the first 5 natural numbers.
32 Java program to print numbers from 1 to 10 using loop.
33 Java program to calculate the sum of first 10 natural number using loop.
34 Java program to find the factorial value of any number entered through the keyboard.
35 Java program that prompts the user to input an integer and then outputs the number with the digits reversed order.
36 Java method to compute the average of three numbers.
37 Java method to find the smallest number among three numbers.
38 Java method to count all words in a string.
39 Java method to compute the sum of the digits in an integer.
40 Java program to create a new array list, add some elements (string) and print out the collection.
41 Java program to insert an element into the array list at the first position.
42 Java program to remove the third element from an array list.
43 Java program to round a float number to specified decimals.
44 Java program to test if a double number is an integer.
45 Java program to swap two variables.
46 Java program to convert a decimal number to binary numbers.
47 Java program to convert a binary number to decimal number.
48 Java program to check whether Java is installed on your computer or not.
49 Java program and compute the sum of the digits of an integer.
50 Java program to compare two numbers.
51 Java program to count the letters, spaces, numbers, and other characters of an input string.
52 Java program to print the ascii value of a given character.
53 Java program that accepts an integer (n) and computes the value of n+nn+nnn.
54 Java program to display the system time.
55 Java program to print the odd numbers from 1 to 20.
56 Java program to print the even numbers from 1 to 20.
57 Java program to convert a string to an integer.
58 Java program to convert seconds to hour, minute, and seconds.
59 Java program to compute the sum of the first 100 prime numbers.
60 Java program to calculate average marks.
61 Java program to check vowel or consonant.
62 Java program to sum of N numbers.
63 Java program to find factorial of any number.
64 Java Program to calculate electricity bill.
65 Java Program to Calculate CGPA Percentage.
66 Java Program to calculate compound interest.
67 Java Program to Calculate Batting Average.
68 Java Program to Calculate Commission Percentage.
69 Java Program to Find Distance Between Two Points.
70 Java Program to Calculate Power of Number.
71 Write a java program to get the length of a given string.
72 Write a java program to print current date and time in the specified format.
73 Write a Java program to get the character at the given index within the String.
74 Write a java program to remove a particular character from a string.
Intermediate
75 Write a java program to reverse a String.
76 Write a java program to remove html tags from a string.
77 Write a java program to count total number of lines from a string.
78 Write a Java program to insert an element (specific position) into an array.
79 Write a Java program to reverse an array of integer values.
80 Write a Java program to find the common elements between two arrays.
81 Write a Java program to find the duplicate values of an array of integer values.
82 Write a Java program to convert an array to Array List.
83 Write a Java program to add two matrices of the same size.
84 Write a Java program to find second largest number from the array.
85 Write a Java program to find second lowest number from the array.
86 Write a Java program to find the number of even and odd integers in a given array of integers.
87 Write a Java program to get the difference between the largest and smallest values in an array of integers.
88 Write a java program to check vowel or consonant.
89 Java program to display the cube of the number upto given an integer.
90 Write a Java program to display the n terms of odd natural number and their sum.
91 Java program to display the multiplication table of a given integer.
92 Java program that reads an integer and check whether it is negative, zero, or positive.
93 Java program that reads a set of integers, and then prints the sum of the even and odd integers using loop.
94 Java program to check whether the number is a prime number or not.
95 Java program to calculate HCF of Two given numbers using loop.
96 Java method to check numbers is palindrome number or not.
97 Java method to displays prime numbers between 1 to 20.
98 Java method to find GCD and LCM of Two Numbers.
99 Java method to find factorial using recursion in java.
100 Java program to sort a given array list.
101 Java program to shuffle elements in an array list.
102 Java program to increase the size of an array list.
103 Java program to reverse elements in an array list.
104 Java program to round up the result of integer division.
105 Java program to swap the first and last elements of an array and create a new array.
106 Java program to count the number of even and odd elements in a given array.
107 Java program to compute the square root of a given integer.
108 Java program to check if a positive number is a palindrome or not.
109 Java program to add two numbers without using any arithmetic operators.
110 Java program to add all the digits of a given positive integer.
111 Java program to segregate all 0s on left side and all 1s on right side of a given array of 0s and 1s.
112 Java program to cyclically rotate a given array clockwise by one.
113 Java program to print all unique element in an array.
114 Java Program to Sort the Array in an Ascending Order.

Advanced
115 Java Program to Sort the Array in a Descending Order.
116 Java Program to Sort Names in an Alphabetical Order.
117 Java Program to Display Transpose Matrix.
118 Java Program to Search Key Elements in an Array.
119 Java Program to Accept the Marks of a Student and find Total Marks and Percentage.
120 Java program that reads a positive integer and count the number of digits.
Advanced
121 Java program that accepts three numbers and check All numbers are equal or not.
122 Java program that accepts three numbers from the user and check if numbers are in “increasing” or “decreasing” order.
123 Java program that determines a student’s grade.
124 Java program to create a simple calculator.
125 Java program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros.
126 Java program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered.
127 Java program to print out all Armstrong numbers between 1 to 600 using loop.
128 Java program to count total number of notes in entered amount using loop.
129 Java program to print Fibonacci series of n terms where n is input by user using loop.
130 Java program to calculate the sum of following series where n is input by user.
131 Java program to compare two array lists.
132 Java program to swap two elements in an array list.
133 Java program to join two array lists.
134 Java program to empty an array list.
135 Java program to convert a float value to absolute value.
136 Java program to accept a float value of number and return a rounded float value.
137 Write a method that overloads the talk method by taking in a name and printing “Hello” with that name.
138 Use Inheritance concept to Create a class and specify the parent class with one method, use the extends keyword in the class header of the child class with same method. create object for both class and call the method using each objects.
139 Override the taste method from the Candy class in the Chocolate class to return “tastes chocolately”. It should print “tastes sweet!” and then “tastes chocolately”.
140 Overload the greet method to just print “Hello” if not given any parameters. It should print “Hello” and then “Hello Sansa”.
141 Add a call to Pet’s brag method before printing anything in Dog’s brag method (hint: use super to call an overridden method). It should print “I have the best pet!” and then “I have the best dog”.
OOPs Concepts Programs
Create a constructor for person class with name and age as parameter. Inherit the person class by using Teacher child class. Teacher class should have constructor with three parameters (name, age,
142 degree).Use super(parm1,parm2) to call the parent’s constructor. This is especially useful to initialize inherited fields. This should print like “Dharma 30” followed by “Dhana 32 PhD”.
143 Create public getter and setter methods to the Store class so its variables can be accessed by other classes. It should print the store’s name and address and then change both and print the new values.
144 Create a program a use all the OOPs concepts under one program
145 Create a Dog subclass for the abstract Animal class with two abstract methods speak and eat. Override the abstract methods. It should print “woof” and then “num num”.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy