Basic Programming Questions in Java Interview

1. Java Programme for Fibonacci Series:

Answer — Fibonacci Series is the sequence of numbers. Each number in the sequence is the sum of two numbers that precede it.
Mathematical equation is Xn+2 = Xn+1 +Xn
public class Fibonacciseries
{

2. Write a Java Programme for Array Sorting:

Answer

3. Write a Java Programme for Array Sorting in Ascending Order or BubbleSort:

Answer

4. Write a Java Programme for Array Sorting in Descending Order or BubbleSort:

Answer

5. Operators in Java:

Answer

6. Write a Java Programme to Find two lowest and two highest numbers in an Array:

Answer

7. Java Programme to extract only characters from String

Answer

8. Write a Java Programme to Reverse a String

Answer — There are multiple ways to Reverse a String:

9. Write a Java program to check Leap Year:

Answer — A Leap year is a year having 366 days instead of the usual 365 days and occur almost every four years. Leap years are years where an extra, or intercalary day is added to the end of the shortest month, February.

10. Write a Java Programme to check prime numbers.

Answer

11. Write Java Programme to check whether String is Palindrome or not?

Answer

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
TechiesHub9

TechiesHub9

Blogger, Software Development, Software Testing