Click here to Skip to main content
15,885,757 members
Home / Discussions / Java
   

Java

 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm918-Jan-18 1:55
hm918-Jan-18 1:55 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan18-Jan-18 2:54
mveRichard MacCutchan18-Jan-18 2:54 
QuestionWhat is wrong with this java code, why is it not printing Factorial? Pin
Member 1362428615-Jan-18 10:02
Member 1362428615-Jan-18 10:02 
AnswerRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Richard MacCutchan15-Jan-18 21:45
mveRichard MacCutchan15-Jan-18 21:45 
GeneralRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Member 1362428616-Jan-18 2:07
Member 1362428616-Jan-18 2:07 
GeneralRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Richard Deeming16-Jan-18 3:07
mveRichard Deeming16-Jan-18 3:07 
AnswerRe: What is wrong with this java code, why is it not printing Factorial? Pin
vishaljamdagni29-Jan-18 18:58
professionalvishaljamdagni29-Jan-18 18:58 
QuestionJava Array Out Of Bound Issue Pin
Akshit Gupta13-Jan-18 5:50
Akshit Gupta13-Jan-18 5:50 
I have a code for Java in which I am creating 2 Array List from 2 dimensional array.. But I am getting an Array Out Of Bound exception.. I am passing 2 dimensional array to my class method answer.. But it is not working..

    import java.io.*;
    import java.util.*;
    
    public class Abc {
        static void answer(Integer[][] a,int l){
            Integer[] un = new Integer[l];
            Integer[] un1 = new Integer[l];
            final Integer z = 0;
            int max1=0,max2=0,count1=0,count2=0; 
            int ind=0;
            ArrayList<integer> arr1 = new ArrayList<integer>(Arrays.asList(a[0][l]));
            ArrayList<integer> arr2 = new ArrayList<integer>(Arrays.asList(a[1][l]));

            for(int i=0;i<l;i++){
 if(i="" %="" 2="=" 0){
="" max1="Collections.max(arr1);
" count1="" +="max1;
" ind="arr1.indexOf(max1);
" arr1.set(ind,z);
="" arr2.set(ind,z);
="" }
="" else{
="" max2="Collections.max(arr2);" 
="" count2="" arr2.set(ind,0);
="" arr1.set(ind,0);
="" }

="" if(count1="" <="" count2){
="" system.out.println("second");
=""> count2){
                    System.out.println("First");
                }
                else{
                    System.out.println("Tie");
                }

            }

        }
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);        
            int times = sc.nextInt();
            for(int i=0;i

AnswerRe: Java Array Out Of Bound Issue Pin
phil.o13-Jan-18 6:20
professionalphil.o13-Jan-18 6:20 
QuestionRemove All Items in nested HashMap Pin
Member 1354659210-Jan-18 9:12
Member 1354659210-Jan-18 9:12 
AnswerRe: Remove All Items in nested HashMap Pin
Richard MacCutchan10-Jan-18 23:27
mveRichard MacCutchan10-Jan-18 23:27 
GeneralRe: Remove All Items in nested HashMap Pin
Member 1354659211-Jan-18 0:04
Member 1354659211-Jan-18 0:04 
QuestionEclipse, windows disappear Pin
C-P-User-310-Jan-18 1:41
C-P-User-310-Jan-18 1:41 
AnswerRe: Eclipse, windows disappear Pin
Richard MacCutchan10-Jan-18 1:58
mveRichard MacCutchan10-Jan-18 1:58 
Questionfor fingerprint code in java Pin
Member 136066264-Jan-18 1:25
Member 136066264-Jan-18 1:25 
AnswerRe: for fingerprint code in java Pin
Richard MacCutchan4-Jan-18 2:24
mveRichard MacCutchan4-Jan-18 2:24 
QuestionConnection Issue between Netbeans 8.2 and SQL Server 2014 Pin
Member 1360161431-Dec-17 20:23
Member 1360161431-Dec-17 20:23 
SuggestionRe: Connection Issue between Netbeans 8.2 and SQL Server 2014 Pin
Richard MacCutchan31-Dec-17 22:51
mveRichard MacCutchan31-Dec-17 22:51 
AnswerRe: Connection Issue between Netbeans 8.2 and SQL Server 2014 Pin
jschell1-Jan-18 6:57
jschell1-Jan-18 6:57 
QuestionJava Project Pin
Member 1359041122-Dec-17 7:42
Member 1359041122-Dec-17 7:42 
AnswerRe: Java Project Pin
Richard MacCutchan22-Dec-17 21:13
mveRichard MacCutchan22-Dec-17 21:13 
GeneralRe: Java Project Pin
barrontD2-Jan-18 19:28
barrontD2-Jan-18 19:28 
QuestionJava Pin
zakarie mukhtar abdi21-Dec-17 20:07
zakarie mukhtar abdi21-Dec-17 20:07 
AnswerRe: Java Pin
Richard MacCutchan21-Dec-17 21:44
mveRichard MacCutchan21-Dec-17 21:44 
RantRe: Java Pin
Richard Deeming22-Dec-17 2:05
mveRichard Deeming22-Dec-17 2:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.