Regarding method returns multiple values

Regarding method returns multiple values

Hi, 1)I have a requirement like,1 method returns multiple values.how to do that one. 2)can i use method, for example like getFile()[] in this way or not. plzzzzzzzzzzzzzzzzzz provide the code...

View Answers

August 26, 2011 at 4:19 PM

Hi, Sorry i don't think that a method can return multiple data-types.

A method can return multiple values but only single data-type. i.e

public String[] getData() { String[] data = new String[10]; for(int i = 0; i < 10; i++) { data[i] = ; // Some exp } return data;

}

This 'll return an array of data.









Related Tutorials/Questions & Answers:
Regarding method returns multiple values
Regarding method returns multiple values  Hi, 1)I have a requirement like,1 method returns multiple values.how to do that one. 2)can i use method, for example like getFile()[] in this way or not. plzzzzzzzzzzzzzzzzzz provide
Java Method Return Multiple Values
Java Method Return Multiple Values In this section we will learn about how a method can return multiple values in Java. This example explains you how a multiple values can be return by a method. This example explains you all
Advertisements
How to return multiple values from a method - Java Beginners
How to return multiple values from a method  I came the following method "How do I return multiple values from a method?" posted elsewhere..."; /** * This is returning a single Object, which contains * multiple values
How to return multiple values from a method - Java Beginners
How to return multiple values from a method  I came the following method "How do I return multiple values from a method?" posted elsewhere..."; /** * This is returning a single Object, which contains * multiple values
query regarding multiple select
query regarding multiple select  i have a select in jsp with multiple options.When i select multiple values i am not able to insert it into database and how do i retrieve them..please help me with an example code
multiple select values
multiple select values   can you provide an example for multiple select values for html:select tag
select tag multiple values
select tag multiple values   I want to insert multiple values in database which i have selected from select tag
retrieve multiple attribute values
XML retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <...; What I would like is to retrieve both the attribute values of process
retrieve multiple attribute values
retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <process... like is to retrieve both the attribute values of process:Output during execution
retrieve multiple attribute values
retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <process... like is to retrieve both the attribute values of process:Output during execution
Example for a method in java which returns a class
Example for a method in java which returns a class  Hi, I want to create a 1 class,and declare some methods there.I need to method must returns a classname.when i call that particular method(which returns a class),how can i
Generic method that returns the biggest item in the list.
Generic method that returns the biggest item in the list.  class EngineerProject{ String engrName; double totalBudgets; String department... } } Write a generic method that returns the biggest item in the list. Each
Retriving multiple values of checkboxes in struts
Retriving multiple values of checkboxes in struts  how to retrive multiple values of checkboxes of jsp in action class   JSP Retrieve checkbox values 1)checkbox.jsp: <html> <body> <form method="post
Method which returns area of circle - Java Beginners
Method which returns area of circle  Need simple Java Method example that returns area of circle  Java Example CodeWith the help of given Java code you can return the area of a circle and give the radius
@SessionAttributes multiple values
@SessionAttributes multiple values In this section we will see how you can use @sessionattributes to set multiple session values to it. While developing... for multiple values are: @SessionAttributes({"formdata","
Example of values() method of HashMap.
Example of values() method of HashMap. The values() is the method of java HashMap. It returns a collection object of HashMap values.  Code: ...(); System.out.println("Values : " + str); } } } Output
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one value at a time without any prb, but I am unable to carry multiple (from two
How to carry multiple values from a Servlet to a JSP?
How to carry multiple values from a Servlet to a JSP?  By using the below code I am able to carry the username to a JSP (single value). ----response.sendRedirect("index.jsp?uname="+username);---- But I want multiple values
i am getting multiple values in listbox
i am getting multiple values in listbox   hi sir, i am using... table group by stuname) order by a.name in a subquery multiple recdates i am getting its working fine, but in main query also i am getting multiple name
retrieve multiple columns values from multiple csv files in java
retrieve multiple columns values from multiple csv files in java  Suppose there is folder in C:\fileupload which contains these two csv files: file1.csv has 3 columns(VendorID,Name) file2.csv has 2 columns(VendorID,address
Java bigdecimal valueOf long method
valueOf method. Method returns bigdecimal valuesMethod converts the long values in to bigdecimal value. Method returns a static bigdecimal object... Java bigdecimal valueOf long method   
Java bigdecimal subtract method example
class subtract method. Method returns bigdecimal object values as per context... and double types values. ADS_TO_REPLACE_1 Syntax for using the method: public... Java bigdecimal subtract method example   
JavaScript method fromCharCode()
fromCharCode(). The fromCharCode() method returns a readable string from the specified...' is the series of Unicode character values. This method is a static method... JavaScript method fromCharCode()     
calling a javascript function by passing multiple values from applet in web application
calling a javascript function by passing multiple values from applet in web application  Hi all, I have a requirement like this, I have to call a javascript function from JApplet by passing 3 values. I am new to Applets
Multiple values for a single parameter
Multiple values for a single parameter   ... the values we have entered in the html form by the method getParameterValues() which returns the array of String.  At last to retrieve all the values from
retaining the selected values in html:select multiple="true" in jsp + collection + struts
retaining the selected values in html:select multiple="true" in jsp + collection + struts  Hi, I have a multiple selection box in one of the jsp...;strong> <html:select multiple="true" style="width
Facing Problem to insert Multiple Array values in database - JSP-Servlet
Facing Problem to insert Multiple Array values in database  Hai friend , Iam beginner in jsp and creating the project in shopping cart but ihave... Quantity and Price . Pl help me to insert the multiple books details
I want to update the multiple values of database depending on checkbox..? Please help me out..
I want to update the multiple values of database depending on checkbox..? Please help me out..   Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java... is displaying.. i need code in java so that it takes multiple values... where i have to select multiple keyskills. but it is taking only one valuee.. i
code to enter values in multiple textfields throught 10 buttons (0-9) (as if a calculator programe)
code to enter values in multiple textfields throught 10 buttons (0-9) (as if a calculator programe)  how can i enter values in two different textfield's through 10 different buttons.?? as we saw a online calculator type
JavaScript Math.sin() method
JavaScript Math.sin() method       JavaScript's Math.sin() method returns mathematical sine... have created an input box into which user can input the values for sin() method
please clarify regarding capacity method of my below string buffer class example
please clarify regarding capacity method of my below string buffer class example  hi here is the program below: > import java.lang.*; public class > Compare{ public static void > main(String[] args) { >
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row  Hai, I need... or .txt) file and get the values from that file and store them into database
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array  i am using netbeans 7.0 ,with struts 1.3.8 and i want to insert multiple images in mysql database ,with use
JavaScript method cos()
JavaScript method cos()       This section illustrates you the use of JavaScript method cos(). The method cos() returns the cosine of the specified number. It returns the numeric value
how to get multiple hyperlink values from a table column to another jsp file?
how to get multiple hyperlink values from a table column to another jsp file?  dear sir: this is what i'm trying to do, i have 3 JSP files. first...;body> <ht>TST1 DB</h1> <form action="dbtable.jsp" method="post
Remove multiple elements in arraylist
Remove multiple elements in arraylist   how can we remove multiple values in arrayList? only remove method we used for single remove.but i want to delete multiple value in arrayList
regarding interview in java
regarding interview in java  why java doesnot suppor muliple inheritance   Java does not support multiple inheritance directly but it supports multiple inheritance through interface.When we extends more than one class
JavaScript getFullYear method
JavaScript getFullYear method       JavaScript method getFullYear() returns present year. To illustrate getFullYear() method here we have created a button in the HTML page when you
regarding struts 2
regarding struts 2   is it not possible to get values from applicationresources.properties into our application in struts 2
String.equals()
between the given objects... and the method returns "true" in case...In Java programming language, equals() is method of string class that is used for comparison between two objects. It always returns the output in Boolean
Java bigdecimal valueOf long example
valueOf method. Method returns bigdecimal valuesMethod converts the long values in to bigdecimal value. Method returns a static bigdecimal object. Syntax for using the method: static BigDecimal longValue(long ln)  Suppose we
Java bigdecimal ulp example
ulp method. Method returns  bigdecimal valuesMethod returns... object value.  Method returns +1 for a positive bigdecimal value... and double types values. ADS_TO_REPLACE_2 Syntax for using the method
Java bigdecimal valueOf double example
class valueOf  method. Method returns bigdecimal valuesMethod converts the double value in to bigdecimal value. Method returns a static bigdecimal object. Method generates NumberFormatException, if  the double value
Java bigdecimal multiply method example
multiply method example. Method returns a bigdecimal object value. Method... are created and assigned integer as well double type valuesMethod throws... Java bigdecimal multiply method example   
Java bigdecimal stripTrailingZeros example
class stripTrailingZeros method. Method returns bigdecimal object values. This bigdecimal class method generates bigdecimal values after removing the trailing zeros of  the fractional part. Value returned by the method is numerically
Java bigdecimal subtract
method. Method returns bigdecimal object values. This bigdecimal class method subtracts the object value( in which the method is invoked) by the value of object... than integers and double types values.  Syntax for using the method: public
Java BigDecimal abs example
;    Example below shows working of .abs() method of bigdecimal class. Method always returns absolute values. Here it returns the absolute values of bigdecimal class objects big_0 & big_1 respectively
Java bigdecimal unscaledValue example
class unscaledValue method. Method returns biginteger values.  An un scaled.... Method generates NumberFormatException, if it finds the bigdecimal value other than integers and double types values.  Syntax for using the method: public
JavaScript parentElement method
JavaScript parentElement method       JavaScript's parentElement() method returns reference to the parent element of the specified element. By using the parentElement() method we can

Ads