Reading title and description of URL using jsoup

This is a sample program to read title and description of specified url. Wh have used java html parser jsoup for this program. for that you have to include jsoup-1.7.2.jar(used in this program). First we have to connect to url using Document doc Jsoup.connect(url).get(); To get title call title() that will return String value String … Read more

High quality thumbnail generation in java

I am generating high quality thumbnail in java for that I am using java-image-scaling High quality image scaling library which is provided under Change license to The BSD 3-Clause License For running this program you have to include java-image-scaling-0.8.6.jar and Filter.jar This is example to generate thumbnail with maintaining aspect ratio

Java Program Structure and First Program

Here we will see the structure of the java program and create a java first program in notepad and run it 1. Structure of Java Program Let’s see the basic structure of the java program  class className { //main method of java program public static void main(String args[]) { //program execution starts from main method … Read more

Super keyword in Java with uses and examples

What is Super keyword in Java A Super keyword in java is a keyword used to access immediate parent class instance variable, methods and constructors. java super keyword used in classes where inheritance hierarchy exists. Uses of super keyword in Java In Java super keyword is used when a sub class wants to refer its … Read more

Even or odd program in java

The number which is divisible by 2 is known as even number and the number which is not divisible by 2 is odd number. in programming we use % operator to check divisibility. The % operator returns the remainder of division. If a number is completely divisible its remainder is 0. So any number is … Read more

Splitting the strings in words

String reverse program in java

In Java, you can reverse a string in several ways. Here are three common methods to reverse a string: String reverse program in java using StringBuilder public class StringReverseExample { public static void main(String[] args) { String original = “Hello, World!”; StringBuilder reversed = new StringBuilder(original).reverse(); String reversedString = reversed.toString(); System.out.println(“Reversed string: ” + reversedString); … Read more

Thread suspend() and resume() method in Java

suspend() : This method suspend a thread for sometime but do not kill/terminate it. resume() : This method revives the suspended thread. class A extends Thread { public void run() { for (int i = 1; i

Java Applet Example

To run applets we use  appletviewer . An appletviewer is command line program to invoke an applet program from command line. Here we will see how to run applet from applet viewer Example : Write a simple applet program to print “ Hello Students” import java.applet.Applet; import java.awt.Graphics; /* */ public class APdemo extends Applet { String … Read more