How to return an array in Java

JavaTpoint

In this section, we are going to learn how to return an array in Java.

Remember:

Example 1

In the following example, the method returns an array of integer type.

Output:

How <a href=to return an array in Java" />

Example 2

In the following example, the method returns an array of double type.

Output:

How <a href=to return an array in Java" />

Example 3

In the following example, method returns an array of object type.

Output:

How <a href=to return an array in Java" />

Next Topic Java Tutorial

Youtube

For Videos Join Our Youtube Channel: Join Now

Feedback

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials

Splunk tutorial

SPSS tutorial

Swagger tutorial

T-SQL tutorial

Tumblr tutorial

React tutorial

Regex tutorial

Reinforcement learning tutorial

R Programming tutorial

RxJS tutorial

React Native tutorial

Python Design Patterns

Python Design Patterns

Python Pillow tutorial

Python Turtle tutorial

Keras tutorial

Preparation

Aptitude

Logical Reasoning

Verbal Ability

Company Interview Questions

Trending Technologies

Artificial Intelligence

AWS Tutorial

Selenium tutorial

Cloud Computing

Hadoop tutorial

ReactJS Tutorial

Data Science Tutorial

Angular 7 Tutorial

Blockchain Tutorial

Git Tutorial

Machine Learning Tutorial

DevOps Tutorial

B.Tech / MCA

DBMS tutorial

Data Structures tutorial

DAA tutorial

Operating System

Computer Network tutorial

Compiler Design tutorial

Computer Organization and Architecture

Discrete Mathematics Tutorial

Ethical Hacking

Computer Graphics Tutorial

Software Engineering

html tutorial

Cyber Security tutorial

Automata Tutorial

C Language tutorial

C++ tutorial

Java tutorial

.<a href=Net Framework tutorial" />

Python tutorial

<a href=List of Programs" />

Control Systems tutorial

<a href=Data Mining Tutorial" />

Data Warehouse Tutorial

Like/Subscribe us for latest updates or newsletter RSS Feed Subscribe to Get Email Alerts Facebook Page Twitter Page YouTube Blog Page

Learn Tutorials

Interview Questions

About

This website is developed to help students on various technologies such as Artificial Intelligence, Machine Learning, C, C++, Python, Java, PHP, HTML, CSS, JavaScript, jQuery, ReactJS, Node.js, AngularJS, Bootstrap, XML, SQL, PL/SQL, MySQL etc.

This website provides tutorials with examples, code snippets, and practical insights, making it suitable for both beginners and experienced developers.

There are also many interview questions which will help students to get placed in the companies.