Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Java program to check if a given character is vowel or consonant

Categories: Basic. No Comments on Java program to check if a given character is vowel or consonant

In this article we will learn to implement a Java program to check if a given character is vowel or consonant. Following Java program reads a character from the user and prints out whether it is a vowel or not: import java.util.Scanner; public class Driver { public static void main(String[] args) { Scanner input = […]

Read the rest of this entry »

Java program to print even numbers in the range 1 to n

Categories: Basic. No Comments on Java program to print even numbers in the range 1 to n

In this article we will learn to implement a Java program to print even numbers in the range 1 to n. Following java program reads n value from the user and prints even numbers in the range 1 to n.   Program is as follows: import java.util.Scanner; public class Driver { public static void main(String[] […]

Read the rest of this entry »

Java program to compute the sum of digits in a given integer

Categories: Basic. No Comments on Java program to compute the sum of digits in a given integer

In this article we will learn to implement a java program to compute the sum of digits in a given integer. A java program is provided below which reads a number from the user and prints out the sum of individual digits in the given number. For example, if the given number is 1234, program […]

Read the rest of this entry »

Java program to print Fibonacci series up to n terms

Categories: Basic. No Comments on Java program to print Fibonacci series up to n terms

In this article we will learn to implement a Java program to print Fibonacci series up to n terms. A java program is provided below which accepts the number of terms to display in the Fibonacci series and prints it:   Program is as follows: import java.util.Scanner; public class Driver { public static void main(String[] […]

Read the rest of this entry »

Java program to add two numbers

Categories: Basic. 2 Comments on Java program to add two numbers

In this article we will learn to implement a Java program to add two numbers. A java program is provided below which reads two numbers from the user and displays their sum.   Program is as follows: import java.util.Scanner; public class Driver { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter […]

Read the rest of this entry »

Applet program to handle mouse events

Categories: Applets. No Comments on Applet program to handle mouse events

In this article we will learn to implement an Applet program to handle mouse events. A Java applet program is provided below to handle various mouse events.   Program is as follows: import java.applet.*; import java.awt.*; import java.awt.event.*; public class MouseApplet extends Applet implements MouseListener { String msg="Initial Message"; public void init() { addMouseListener(this); } […]

Read the rest of this entry »

Applet program to draw lines, ovals, and rectangles

Categories: Applets. 2 Comments on Applet program to draw lines, ovals, and rectangles

In this article we will implement an Applet program to draw a line, oval and rectangle. An Applet program is provided below to draw lines, ovals, and rectangles.   import java.applet.*; import java.awt.*; public class GApplet extends Applet { public void paint(Graphics g) { g.drawLine(20, 20, 500, 20); g.drawRect(20, 40, 200, 40); g.fillRect(300, 40, 200, […]

Read the rest of this entry »

Applet program to display file content

Categories: Applets. No Comments on Applet program to display file content

In this article we will learn to implement a Java Applet program to display file content. An Applet program is provided below that displays the content of the file whose name and extension is sample.txt.   Program is as follows: import java.applet.*; import java.awt.*; import java.io.*; public class MyApplet extends Applet { public void paint(Graphics […]

Read the rest of this entry »