Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to do combinations in java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


nani
how to do combinations in java
1 Answer(s)      6 years and a month ago
Posted in : Java Beginners



Advertisement
View Answers

November 19, 2008 at 11:23 PM


Hi friend,

Code to solve the problem :

import java.util.*;
class ArrayListExample
{
public static void main(String[] args)
{
ArrayList a = new ArrayList();
a.add("c1_p2");
ArrayList b = new ArrayList();
b.add("c1_p1");
b.add("c2_p2");
b.add("c3_p1");
b.add("c4_p2");

Iterator itr = b.iterator();
String aObj = "";
while(itr.hasNext())
{
aObj = a.get(0).toString();
System.out.println("action when "+aObj+" and " + itr.next());
}
}
}


For more information on Java.util Package visit to :

http://www.roseindia.net/java/example/java/util/

Thanks


Related Tutorials/Questions & Answers:
how to do combinations in java - Java Beginners
how to do combinations in java  i have 2 arrayLists. i want do the combinations using those 2 lists. example: ArrayList a contains action...()); } } } For more information on Java.util Package visit to : http://www.roseindia.net/java
do the combinations in java, pls help me its urhent - Development process
do the combinations in java, pls help me its urhent  import java.util.*; interface Expression { public void interpret(ArrayList exp); } class OrExpression implements Expression { public void interpret(ArrayList exp
Advertisements
how to make combinations - Development process
how to make combinations  import java.util.*; interface Expression { public void interpret(ArrayList exp); } class OrExpression implements Expression { public void interpret(ArrayList exp) { //wats the logic
How do I compare strings in Java?
How do I compare strings in Java?  How do I compare strings in Java
How do I decompile Java class files?
How do I decompile Java class files?  How do I decompile Java class files
How do I initialize a byte array in Java?
How do I initialize a byte array in Java?  How do I initialize a byte array in Java
How do i do the coding for 'leaving a comment' in java
How do i do the coding for 'leaving a comment' in java  i am designing a webpage.In my webpage i want to add the option of adding a comment by the readers of the page.how do i do
How do I do this program? I'm new to Java programming...
How do I do this program? I'm new to Java programming...  Suppose you want to print out numbers in brackets, formatted as follows: [1] [2] [3] and so on. Write a method that takes two parameters: howMany and lineLength
how do you parse by reference in java(with JGrasp)
how do you parse by reference in java(with JGrasp)  i am a 1st year beginner in java programming(GR 10) at hillcrest High School in south Africa My question is how do you parse by reference in java(with JGrasp) please help me i
HOW TO DO WEBSITE INTERFACE FOR JAVA MODULE
HOW TO DO WEBSITE INTERFACE FOR JAVA MODULE  Hi , Greetings. I have created modules in java separately , example student registration , view information etc. All these modules work fine in browser. I use JCreator. How to place
how do i write a java program for this??
how do i write a java program for this??  ‚??Ask the user if they have a dog. If ‚??yes‚??, ask the user how old is and compute the dog‚??s age in human years. Display the output. If ‚??no‚?? ask the user their age and compute
how to do this?
how to do this?   Given any integer 2D array, design then implement a Java program that will add to each element in the array the corresponding column number and the corresponding row number. Then, it prints the array before
how to do an measure converter in netbeans - Java Beginners
how to do an measure converter in netbeans   hi im not sure... information on joptionpane visit to : http://www.roseindia.net/java/java-tips/GUI/containers/20dialogs/10joptionpane.shtml http://www.roseindia.net/java/java-tips
How do I write a correct micro-benchmark in Java?
How do I write a correct micro-benchmark in Java?  How do I write a correct micro-benchmark in Java
How do I set environment variables from Java?
How do I set environment variables from Java?  How do I set environment variables from Java
How do you map Java Objects with Database tables?
How do you map Java Objects with Database tables?  Hi, How do you map Java Objects with Database tables? thanks
How do i create the node for target SMO in java..???
How do i create the node for target SMO in java..???  How do i create the node for target SMO in java..??? or else whats the method for accessing the target SMO
How do I handle the reaction of a circle and a semi-circle colliding in java?
How do I handle the reaction of a circle and a semi-circle colliding in java?  How do I handle the reaction of a circle and a semi-circle colliding in java
How to do Null validation for a boolean variable - Java Beginners
How to do Null validation for a boolean variable  How to do Null validation for a boolean variable in JAVA?  Hi friend, For solving the problem visit to : http://www.roseindia.net/java/master-java/variables
How do i start to create Download Manager in Java - JSP-Servlet
How do i start to create Download Manager in Java  Can you tell me from where do i start to develop Download manager in java
How do I throw a 404 error from within a java servlet?
How do I throw a 404 error from within a java servlet?  How you can write code in Servlet for throwing the httpd error 404? How to add the configuration for handling the not found error in the web.xml file? Thanks   
How to do url rewritting?
How to do url rewritting?  Dear Sir/Mam I have this link http://localhost:8085/call4admission/admin/home/Admin... to do?Please suggest
how to do this - JavaMail
how to do this  i have created three HTMl documents. i want to display three HTML documents combinely with in a single frame. can i save 3 HTMl combinely as single JSP.If combine how ? Plese send examples not only with HTML's
how to do gui
how to do gui  import java.util.Scanner; import javax.swing.JFrame; import javax.swing.JOptionPane; public class ShippingCost { public static void... is RM" + num1); } } } how to do gui for this coding..tq   import
how to make use of jerry's java image processing filter in java application?is there anyway to do this?
how to make use of jerry's java image processing filter in java application?is there anyway to do this?   how to make use of jerry's java image processing filter in java application?is there anyway to do
do-while Loop in Java
do-while Loop in Java       In some conditions in java, you need to run some statements...; while(condition); In this example you will see how to use the do-while loop
Do-while loop in Java
Do-while loop in Java In this section you will learn about do-while loop in Java. do-while loop is similar to while loop but the difference is do-while loop... condition repeatedly and run at least once. For that we need a do-while loop so
Creating all combinations
abc cab bac acb i mean all the possible combinations so please help me
How do I upgrade mysql?
How do I upgrade mysql?  How do I upgrade mysql
How do you define a constant?
How do you define a constant?  How do you define a constant in php
How do I use JGraph to create a MST(minimum spanning tree) using java?
How do I use JGraph to create a MST(minimum spanning tree) using java?  How do I use JGraph to create a MST(minimum spanning tree) using java? thanks for the help
Advertisements
 

 

 

DMCA.com