×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Venkata sai
has Published
72
Answers
Write a program to convert an array to String in Java?
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 15-Jul-2019 15:14:42
The Arrays class of the java.util package provides a method named toString() this method accepts an array value (of any type) and returns a String.ExampleFollowing Java program accepts various arrays from the user, converts them into String values and prints the results. Live Demoimport java.util.Arrays; import java.util.Scanner; public class ObjectArrayToStringArray { public ...
Read More
Program for converting Alternate characters of a string to Upper Case.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:31:55
You can convert a character to upper case using the toUpperCase() method of the character class.ExampleFollowing program converts alternate characters of a string to Upper Case. Live Demoimport java.util.Scanner; public class UpperCase { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ...
Read More
Program to print a matrix in Diagonal Pattern.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:28:53
Following is the Java program to print diagonal pattern of a given matrix.Example Live Demopublic class DiagonalMatrix { public static void main(String args[]){ int a[][]={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; int rows = a.length; int columns = a[0].length; ...
Read More
Java program to print a given matrix in Spiral Form.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:24:05
Following is a Java program to print the spiral form of a given matrix.Example Live Demopublic class PrintMatrixInSpiralForm { public static void main(String args[]){ int a[][]={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; int w = 0; int x = ...
Read More
Program for printing array in Pendulum Arrangement.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:15:34
To arrange elements of the array following pendulum arrangement.Sort the given array, create an empty array to store the result.Store the 0th element in a variable say temp.Store the element at index 1 in the sorted array in (mid+1)st position of the resultant array, and the next element int the ...
Read More
Program to print Sum Triangle of an array.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:11:21
To generate a sum triangle of a given arrayGet the elements of the array from the user say, myArray[n].Create a two dimensional array say, result[n][n].Store the contents of the given array in the first row from bottom of the 2D array.result[n][i] = myArray[i].Now, from the second row of the 2D ...
Read More
Program for subtracting two matrices.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:07:41
To subtract two matrices −Create an empty matrix.At each position in the new matrix, assign the difference of the values in the same position of the given two matrices i.e. if A[i][j] and B[i][j] are the two given matrices then, the value of c[i][j] should be A[i][j] - B[i][j].Example Live Demopublic ...
Read More
Recursive program to find an element in an array linearly.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:05:15
Following is a Java program to find an element in an array linearly.Example Live Demoimport java.util.Scanner; public class SearchingRecursively { public static boolean searchArray(int[] myArray, int element, int size){ if (size == 0){ return false; } if ...
Read More
Java program to cyclically rotate an array by one.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:03:28
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.Example Live Demoimport java.util.Arrays; import java.util.Scanner; public ...
Read More
Java program for Multiplication of Array elements.
Java 8
Object Oriented Programming
Programming
venkata sai
Published on 12-Jul-2019 12:01:27
To find the product of elements of an array.create an empty variable. (product)Initialize it with 1.In a loop traverse through each element (or get each element from user) multiply each element to product.Print the product.Example Live Demoimport java.util.Arrays; import java.util.Scanner; public class ProductOfArrayOfElements { public static void main(String args[]){ ...
Read More
1
2
3
4
5
6
7
8
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout