36,051 Topics

Member Avatar for
Member Avatar for rnjreddy

double[][] a= new double[5][5]; int i,j; int [] controller= new int[5]; Random rand=new Random(); for(i=0; i<5; i++ ) { for(j=0; j<5; j++) { do { a[i][j]= rand.nextDouble(); if(a[i][j]>0.0) controller[j]++; System.out.println("a[" + i + "][" + j + "] = " +a[i][j]); }while( controller[j]==3); } } /* I create some random …

Member Avatar for rnjreddy
0
134
Member Avatar for toring

Hi, I need some help please I am still learning java,How can i convert infix to posftix using BST?...so far this is what i have got. Thank you in advance. `package com.binarysearchtree.BSTNode; class Node { private Object item; private Node next; public Node(Object item,Node next) { this.item = item; this.next …

Member Avatar for toring
0
174
Member Avatar for moaz.amin.37

any one is here that explain to me that how to get console input using BufferReader in java and explain me its working briefly.

Member Avatar for moaz.amin.37
0
410
Member Avatar for Junk_1

I have a problem with `asynctask` in android Java. it's the same problem as this : http://stackoverflow.com/questions/15457482/variable-returns-null-outside-asynctask-android my asynctask get data from a url , to get direction of `google maps` ! This is where I call my code , inside onrespondre => myvaraible have data but outside the variable …

0
124
Member Avatar for gear762

I have a rectangle "ball" that is striking another rectangle "b1". I'm trying to make b1 the color of the background and not able to be hit by the ball object anymore, but I don't know how to do that and I couldn't find anything online. Any help is greatly …

Member Avatar for mKorbel
0
219
Member Avatar for shomy

Hello I have final project for java and I didn't know how to do it >< may help me to solve it?! ------------------- Consider the following table about students’ grades for quizzes in class : http://s8.postimg.org/a9sqir7md/Screenshot_2014_05_28_11_26_53.png 2 Write a Java application that calculates the minimum, maximum, and average for each …

Member Avatar for shomy
-1
287
Member Avatar for gaurav_17
Member Avatar for JamesCherrill
-1
95
Member Avatar for Muni123
Member Avatar for JamesCherrill
0
101
Member Avatar for GRENDY

hi everyone im studing computer science , i have question about margeSorting i do not undrstant how it going ??? i do not know where i shold put my question public static int[] mergeSort(int[] a) { if (a.length == 1) { return a; } else { int n = a.length …

Member Avatar for stultuske
0
156
Member Avatar for 203428

hello everybody; up to what level can I use javascript (taking advantage of the strength of phonegap or Titanium) to create an android application. ex 1:can I create or run a service (in the android sense) !!! ?? or can I access to the GSM properties like provide package android.telephony.gsm. …

Member Avatar for 203428
0
247
Member Avatar for AbstractEden

I'm having some issues with one of my bonus assignments for school. In my code the purpose of the project is posted, but this is what I have so far. /******************************************** *File Name: Combination (Assignment 8 Part 1) *Purpose: Create a frame with ten buttons, labeled 0 through 9 (Hint: …

Member Avatar for Hiroshe
0
1K
Member Avatar for Gracious_1

So here's a bit about the details. I need to read the contents of file A, and B and store it in file C by joining the contents of A and B and also counting the number of letters/characters present in it. I've come up with this so far. Can …

Member Avatar for Gracious_1
0
310
Member Avatar for howemonster

So I am writing a program to read text from a file. Save from an array list to an array and then parse that array for ',' and use that to change words position in the 2d array i will write from the 1d array. So essentially String[]{"a,b,c","d,e,f"} ought to …

Member Avatar for howemonster
0
149
Member Avatar for MasterHacker110

I am trying to figure out where is Java and C# mostly used? I read that enterprises favors Java and JEE, but they don't say anything about JSE. I also read that C# is being used a lot, especially on Windows platforms. But the question remains, what do enterprises use …

0
100
Member Avatar for Doogledude123

I'm trying to make this as easy as possible but I'm stuck. Inside the for loop, if the input entered was not a number or wasn't valid, it moves on, but I don't want it to. I want it to repeat that interation. Is there a possible way to do …

Member Avatar for JamesCherrill
0
398
Member Avatar for LVZombie

I am now on part 3 of a payroll program for my Java class but I did not add the while loop in last week so I need to figureout what I did wrong so I can do part 3. The program should loop until the user enters "stop" It …

Member Avatar for jwenting
0
256
Member Avatar for anand11mc04

sir , I have need to start a thread on click of submit button on my jsp page. I am using Java Bean for Codeing. please write small program to start thread on button click of jsp page. Thank you.......

Member Avatar for stultuske
0
88
Member Avatar for nickkipr

package dmaze2; import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class Dmaze2 extends JPanel { JTable jt; ImageIcon Icon = new ImageIcon("x.png"); JTable imagelabel = new JTable(Icon); public Dmaze2() { Object[] columns = {"1","2","3","4","5","6","7","8"}; Object[][] table={{"f","f","f","f","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}, {"f","f","f","o","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}, {"f","f","f","f","f","f","f","f"}}; …

Member Avatar for mKorbel
0
239
Member Avatar for Vlad_2

// Convert Celsius to Fahrenheit and vice versa. import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JTextField; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; public class ConvertTemp extends JFrame { // instance variables JLabel labelFahr; JLabel labelCels; JTextField textFahr; JTextField textCels; JButton conFahToCel; JButton conCelToFah; public ConvertTemp () { super …

Member Avatar for Vlad_2
0
8K
Member Avatar for Builder_1
Member Avatar for Hiroshe
0
139
Member Avatar for SpottyBlue

I was doing my 2nd assignment to create a bank program using Java. I got a problem when I run a few times. For example, I entered the starting amount as $50000. Then, I choose withdraw. I tried to enter withdrawal amount as $5000. Then, I choose to check balance, …

Member Avatar for howemonster
0
418
Member Avatar for abra_ka_dabra

Is there ay inbuilt method to convert 2D array into CSV file? e.g. Can anyone give me a hint to convert [1,2;3,4] into a file output.csv?

Member Avatar for howemonster
0
424
Member Avatar for sheelap

some people says that java is not purly oops language like C++.pls suggest me if it is true then why iot is so?

Member Avatar for mike_2000_17
0
207
Member Avatar for MasterHacker110

I am writing a program that will open another form, the user will continue doing stuff on the new form and would then close the form. When and only when this new form closes, the main form should continue with its work and re-enable some components. Here is the code: …

Member Avatar for mKorbel
0
211
Member Avatar for MasterHacker110

I am trying to read a some data that is stored in an xml file and then print it to the screen for the user. But my program isn't working correctly. Here is my XML document: <UserAccounts> <Account AccountNumber="1234567890"> <Password>12345</Password> <Balance>1024.64</Balance> </Account> </UserAccounts> And here is my code: File fXmlFile …

Member Avatar for MasterHacker110
0
303
Member Avatar for Vegito1991

I have been struggled to solve this problem for few days, i was working on multichat application where in this class i want to send the text to the server and and response in the client side, if anyone can help me i really appreciate from what i known the …

Member Avatar for JamesCherrill
0
384
Member Avatar for moaz.amin.37

hi: we use system("cls") function in c++ i need a function or a class or any command that i give it in my code that clear my screen plz help me

Member Avatar for JamesCherrill
0
337
Member Avatar for CervantesLost

Hi, I picked up this code on daniweb and am trying to get it further. Here's the class import java.util.*; import javax.swing.*; public class LibraryBook { private String title; private String author; private int pageCount; //contructor for books title, author, page public LibraryBook(String bookTitle, String bookAuthor, int bookpageCount) { title …

Member Avatar for JamesCherrill
0
189
Member Avatar for masonketcham

This is the last part to my assignment and when I go to compile the last part I come up with 7 errors unsure what it is that it wants me to do. The errors are: C:\Users\Owner\Desktop\week9 part6\Inventory6.java:212: error: illegal escape character strPrice = strPrice.replaceAll("\$", ""); ^ C:\Users\Owner\Desktop\week9 part6\Inventory6.java:270: error: …

Member Avatar for masonketcham
0
187
Member Avatar for Doogledude123

I am trying to create a File Searching Utility that finds all Files with a given Name which searches all Folders (Sub Directories, and Sub Directories of Sub Directories) in a given Directory. I was thinking of a way to use For Loops, or For Each, but that would mean …

Member Avatar for JamesCherrill
0
265
Member Avatar for dev90

<script> function a(){ var filename="test.txt"; </script> <img src="img/test.png" title="?"/> How to get the value of "filename" in "title"?

Member Avatar for Alberto Bucur
0
230
Member Avatar for sana.f.qureshi_1

Hey there good people. well i have implemented the whole code of compiler phase 1. Have implemented al the DFAs and most are working fine. But this comments DFA is giving me grief. What it should do is, it should ignore anything written between { } . but it's not …

Member Avatar for sana.f.qureshi_1
0
180
Member Avatar for valmiki007

How to create a method that takes input string and returns the most frequently occurring letter(s) in string? **Prototype of the function:** public String Duplicate(String str) **Constraints:** 1. If there are two or more letters which are most frequently occuring, then return all possibilities in the output. 2. The input …

Member Avatar for JamesCherrill
0
178
Member Avatar for NyQii

i have to find a round trip for an Edinburgh bike club (data below) using two approaches: a) a conventional search algorithm; b) a genetic algorithm What i must do : 1. Produce a program using a search algorithm of your choice that will find a ‘good’ circuit from Edinburgh …

Member Avatar for jwenting
0
268
Member Avatar for new_2_java

Hi all, I have a multi-threaded program. This program, lets say spawns 10 threads. I would like to update a variable when each thread finishes its job. The reason why I am asking this, is because I would like to show something like progress bar (not really a progress bar, …

Member Avatar for JamesCherrill
0
6K
Member Avatar for Shaikh_1

I m trying insert multiple rows in same database (each row had many fields) on submit but unable to do so. I m successfully able to insert single row but when it comes for multiple rows I got stuck. This is the jsp page where you take an input to …

Member Avatar for Shaikh_1
0
6K
Member Avatar for riffat.jaffery.3
Member Avatar for stultuske
-2
111
Member Avatar for ali11

i just learn about single linkedlist and i am trying to create a program. public class linklis { public static void main(String[] args) { LinkedList ab= new LinkedList(); ab.add("1"); ab.add("2"); ab.add("4"); ab.add("7"); System.out.println("the list" + ab); System.out.println("remove 2nd element: " + ab.Delete(2)); System.out.println(" - print linkedlist size: " + ab.size()); …

Member Avatar for stultuske
0
279
Member Avatar for neutralfox

Hello everyone, I got a small question on encryption, actually I am trying to learn the various techniques to encrypt a message. Now I am trying AES, using the built in security package in Java. The problem is that I am having a problem with this encryption algorithm. Actually I've …

Member Avatar for JamesCherrill
0
1K
Member Avatar for vinnitro

package controller; import dao.CheckDAO; import entity.Users; import java.io.IOException; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.annotation.Resource; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.naming.NamingException; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import model.CipherText; import model.UserService; public class …

Member Avatar for stultuske
0
319
Member Avatar for shelton22

Can any one convert this Java code to c++? import java.util.*; import java.io.*; public class Test { private static HashMap<String, List<String>> left_map_rights; public static void main(String args[]) throws Exception { left_map_rights = new HashMap<>(); BufferedReader r = new BufferedReader(new FileReader("routes.text")); String line; HashMap<String, Void> lines = new HashMap<>(); while ((line …

Member Avatar for Hiroshe
0
390
Member Avatar for Doogledude123

I'm trying to create a set of selectable labels, New Game, Load Game, Options, and Exit. I created a MenuItem class which extends Label, and set up the constructor to use the standard stuff expected from a Label. Here is the class. package com.irridium.echo.menu; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.ui.Label; /** * …

Member Avatar for Galbatorix
0
679
Member Avatar for moaz.amin.37

there is my question that normally in java we create object with new operator but when we want to use String and String is also a class then we declare object without new operator why plz answer my question

Member Avatar for 203428
0
231
Member Avatar for Khan_1

import javax.swing.*; public class BankAccount { //======== fields (attributes, members)====== private String name; private String acctNo; private double balance; private final double MIN_BALANCE = 50; /** initialize all fields as default values */ public BankAccount() { name="N/A"; acctNo="00000"; balance=0; } /** initialize the fields @param n initializes name @param aNo …

Member Avatar for jwenting
0
463
Member Avatar for sasikrishnasamy

Hi to all, It’s one of the question in test, I am confused please someone help. MainClass{ Public static void main(String [] a){ Employee e=new Employee(); for(int i:e){ // Something } Now If I compile this code I will get an error. But without changing for each condition I want …

Member Avatar for jwenting
0
121
Member Avatar for moaz.amin.37

My code is not compile and run Code is Below import java.util.Scanner; class Input { public static void main(String arg[]) { int rno; System.out.print("Enter Your Name = "); System.in.nextInt(rno); } } i think if System.out.println() is run then upper code should have to run but not run please solve this …

Member Avatar for moaz.amin.37
0
553
Member Avatar for xxmp

Hello i made a jsf site. Althought the welcome page is normal all the others are domain/faces/pagename.jsf. How i can fix this problem?

0
63
Member Avatar for Asabre

Write a java application that uses random-number generation to create sentences. Use four arrays of strings called article, noun, verb and preposition. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article and noun. As each word is picked, …

Member Avatar for JamesCherrill
0
466
Member Avatar for sing1006

i have 2 class for example class a and class b. i need the string store at class a pass and use by class b, here is my code for class a and class b. class a public void actionPerformed(ActionEvent arg0) { JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileNameExtensionFilter("Text Files", …

Member Avatar for iamthwee
0
314
Member Avatar for nutandevjoshi

COME ON I HEARD "YOU CAN SPECIFY WHAT CLASS SHOULD DO,NOT HOW".BUT WITHOUT INTERFACE ,EXTREME JAVA PROJECTS CAN BE MADE!! WHY TO MAKE COMPLICATION USING INTERFACE?

Member Avatar for iamthwee
-2
164

The End.