Articles on Trending Technologies

Technical articles with clear explanations and examples

Java Programs for printing Pyramid Patterns. (of numbers)

Venkata Sai
Venkata Sai
Updated on 11-Mar-2026 302 Views

Following is a Java program which prints a pyramid of numbers.Examplepublic class PrintingPyramids {    public static void main(String args[]){       int n,i,j,k=1;       n = 5;       for(i = 0; i

Read More

HTML <blockquote> cite Attribute

Arjun Thakur
Arjun Thakur
Updated on 11-Mar-2026 288 Views

The cite attribute of the element is used to set the source of a quotation. Following is the syntax −Above, url is the source of the quotation. Let us now see an example to implement the cite attribute of the element −Example Magento Magento as stated on the official website:    Magento Commerce, part of Adobe Commerce Cloud, offers a one-of-a-kind eCommerce solution with enterprise power,       unlimited scalability, and open-source flexibility for B2C and B2B experiences.    Magento allows you to create unique, full-lifecycle customer experiences proven to generate more sales. ...

Read More

Java program to print a given pattern. (stars)

Venkata Sai
Venkata Sai
Updated on 11-Mar-2026 855 Views

Following is a Java program which prints a pyramid of numbers.Examplepublic class PrintingPyramidStars {    public static void main(String args[]){       int n,i,j;       n = 5;       for(i = 0; i

Read More

ShortBuffer order() Method in Java

Samual Sam
Samual Sam
Updated on 11-Mar-2026 132 Views

The byte order of the buffer can be obtained using the method order() in the class java.nio.ShortBuffer. This method requires no parameters and it returns the byte order of the buffer.A program that demonstrates this is given as follows −Exampleimport java.nio.*; import java.util.*; public class Demo {    public static void main(String[] args) {       int n = 5;       try {          ShortBuffer buffer = ShortBuffer.allocate(n);          buffer.put((short)12);          buffer.put((short)91);          buffer.put((short)25);          buffer.put((short)18);          buffer.put((short)30);   ...

Read More

DoubleStream sorted() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 137 Views

The sorted() method of the DoubleStream class returns a stream consisting of the elements of this stream in sorted order.The syntax is as followsDoubleStream sorted()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create a DoubleStream and add some elements to the streamDoubleStream doubleStream = DoubleStream.of(78.9, 90.4, 27.9, 20.6, 45.3, 18.5);Now, sort the elements of the streamdoubleStream.sorted().The following is an example to implement DoubleStream sorted() method in JavaExampleimport java.util.*; import java.util.stream.DoubleStream; public class Demo {    public static void main(String[] args) {       DoubleStream doubleStream = DoubleStream.of(78.9, 90.4, 27.9, 20.6, 45.3, 18.5);       System.out.println("Sorted ...

Read More

HTML <area> rel Attribute

Ankith Reddy
Ankith Reddy
Updated on 11-Mar-2026 148 Views

The rel attribute of the element is used to set the relationship between the current document and the linked document. This attribute introduced in HTML5 for the element. Following is the syntax −Above, value can be any of the following options that links to −alternate: An alternate version of the document, for example, to print.author: Author of the documentbookmark: Permanent URL used for bookmarkinghelp: Help documentlicense: Copyright informationnext: Next document in a selectionnofollow: Links to a link which you do not want that the Google indexing to follow that link.noreferrer: Specifies that the browser should not send a HTTP ...

Read More

Java program to cyclically rotate an array by one.

Venkata Sai
Venkata Sai
Updated on 11-Mar-2026 3K+ Views

To rotate the contents of an array cyclically −create an empty variable. (temp)save the last element of the array in it.Now, starting from the nth element of the array, replace the current element with the previous element.Store the element in temp in the 1st position.Exampleimport java.util.Arrays; import java.util.Scanner; public class CyclicallyRotateanArray {    public static void main(String args[]){       Scanner sc = new Scanner(System.in);       System.out.println("Enter the required size of the array ::");       int size = sc.nextInt();       int [] myArray = new int[size];       System.out.println("Enter elements of the ...

Read More

HTML <form> target Attribute

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 413 Views

The target attribute of the element allows you to display the response generated after submitting the form.Following is the syntax −Here, _blank is used to display the response in new window or tab, _self display the response in the same frame, _parent displays the response in the parent frame, _top displays the response in the entire body of the window, frame displays the response in a named frame.Let us now see an example to implement the target attribute of the element −Example Points    Player:    Rank:    Points:    Submit ...

Read More

Recursive program to find an element in an array linearly.

Venkata Sai
Venkata Sai
Updated on 11-Mar-2026 946 Views

Following is a Java program to find an element in an array linearly.Exampleimport java.util.Scanner; public class SearchingRecursively {    public static boolean searchArray(int[] myArray, int element, int size){       if (size == 0){          return false;       }       if (myArray[size-1] == element){          return true;       }       return searchArray(myArray, element, size-1);    }    public static void main(String args[]){       System.out.println("Enter the required size of the array: ");       Scanner s = new Scanner(System.in);       int size = s.nextInt();       int myArray[] = new int [size];       System.out.println("Enter the elements of the array one by one ");       for(int i=0; i

Read More

Use ListIterator to traverse an ArrayList in the reverse direction in Java

Samual Sam
Samual Sam
Updated on 11-Mar-2026 2K+ Views

A ListIterator can be used to traverse the elements in the forward direction as well as the reverse direction in the List Collection. So the ListIterator is only valid for classes such as LinkedList, ArrayList etc.The method hasPrevious( ) in ListIterator returns true if there are more elements in the List while traversing in the reverse direction and false otherwise. The method previous( ) returns the previous element in the List and reduces the cursor position backward.A program that demonstrates this is given as follows −Exampleimport java.util.ArrayList; import java.util.ListIterator; public class Demo {    public static void main(String[] args) { ...

Read More
Showing 8771–8780 of 61,248 articles
« Prev 1 876 877 878 879 880 6125 Next »
Advertisements