java pratice questions
java pratice questions
Basic Java beginner programs for Practice | Java Coding Practice with
examples | Java Programming Examples
1. Write a Java program to take three numbers from the user and print the
greatest number
2. Write a Java program to find the number of days in a month
3. Write a Java program to test a number is positive or negative
4. Write a Java Program to accept number of week’s day (1-7) and print name
of the day
5. Write a Java program that takes a year from user and print whether that year
is a leap year or not
6. Write a Java program to input 5 numbers from keyboard and find their sum
and average
7. Write a program in Java to display the first 5 natural numbers
8. Write a java program to check vowel or consonant
9. Write a Java program to display the cube of the number upto given an
integer
10.Write a Java program to display the n terms of odd natural number and their
sum
11.Write a Java program to display the multiplication table of a given integer
12.Write a Java program that reads an integer and check whether it is negative,
zero, or positive
13.Write a Java program that reads an positive integer and count the number of
digits
14.Write a Java program that accepts three numbers and check All numbers are
equal or not
15.Write a java program that accepts three numbers from the user and check if
numbers are in “increasing” or “decreasing” order.
16.Write a Java program that determines a student’s grade
17.Write a Java program to create a simple calculator
1. Write a Java program to create a new array list, add some elements (string)
and print out the collection
2. Write a Java program to insert an element into the array list at the first
position
3. Write a Java program to remove the third element from a array list
4. Write a Java program to sort a given array list
5. Write a Java program to shuffle elements in a array list
6. Write a Java program to increase the size of an array list
7. Write a Java program to reverse elements in a array list
8. Write a Java program to compare two array lists
9. Write a Java program to swap two elements in an array list
10.Write a Java program to join two array lists
11.Write a Java program to empty an array list