40% DISCOUNT LIMITED SEATS
Java Full Stack + AI Industrial Training 2026
Expert MNC Mentors • Industrial Roadmap • 10 Seats Left
GitHub
Month 01: Lab Setup

Java & GitHub

  • Java 21 & IntelliJ AI Mastery
  • GitHub Team Industrial Flow
  • MNC Standard VS Code Setup
Logic
Month 02: Logic Lab

Logic Mastery

  • Complex DSA with MNC Experts
  • Telugu & English Logic Bridge
  • Daily Problem Solving Drills
Backend
Month 03: API Hub

Spring & SQL

  • Spring Boot 3 Microservices
  • Postman API Automated Testing
  • PostgreSQL DB Architecture
Frontend
Month 04: UI Factory

React & Tailwind

  • React 18 & AI Component Dev
  • Industrial Tailwind UI Library
  • Redux State Management
Cloud
Month 05: Deploy

AWS & Jira Hub

  • Cloud Deploy on Real AWS
  • Agile Scrum with Jira Tools
  • Jenkins CI/CD Pipeline
Success
Month 06: Result

Job Offer Letter

  • Tier-1 MNC Direct Referrals
  • Salary Negotiation Strategy
  • High CTC Placement Pipeline

Java Program to Sort(Descending) an Given Array of Integers | Using Arrays.sort() | StudyEcart | Sorting004

Yogi Siddeswara 0
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package in.studyecart.sorting.array;

import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Lab004 {

	public static void main(String[] args) {
		
        Scanner input=new Scanner(System.in);
		
		System.out.println(">> Array -Number -Sorting <<");
		
		System.out.println("\nPlease Enter size of array:");
		int asize=input.nextInt();
	
		Integer arr[]=new Integer[asize];
		

		//Scanning the numbers from user console area or you can directly take hard-code elements
		//like    int arr[]= {323,454,656,768,678,980,345,620};
		
		System.out.println("Please Enter "+asize +" of Elements into array: ");
		for(int i=0;i<arr.length;i++) {
			arr[i]=input.nextInt();
		}
		
		//Using Arrays class static method sort() from java.util package;
		
	    //Arrays.sort(arr); //Ascending Order 
		//For Descending Order ,we should use Collections.reverseOrder();
		Arrays.sort(arr,Collections.reverseOrder()); 
		System.out.println("\nAfter Sorting arr[]:");
	       for(int i=0;i<arr.length;i++) {
	    	   System.out.println(arr[i]);
	       }

	}

}

Post a Comment

0 Comments