32,199 Topics

Member Avatar for
Member Avatar for omeralper

In the main method of a program we always use the code as a parameter: String[] args What does it mean? In the tutorial of java sun, there is a code following [code]public static void main(String[] args) { //this program requires two arguments on the command line if (args.length == …

Member Avatar for hfx642
0
350
Member Avatar for alony

Hi! I'm trying to have the user input the number of hours, minutes, and seconds, and it output what that is in seconds. WHY WONT IT COMPILE... It says i have an illegal start of expresion at private static double hour(). help? [code] import java.util.Scanner; public class timeTest { public …

Member Avatar for hfx642
0
154
Member Avatar for gahhon

i plan to display all of the odd number, and sum all of the odd number. please check with my code, there is something wrong...:) [ICODE]import java.util.Scanner; public class testing { public static void main(String[] args) { int sum = 0; Scanner scan = new Scanner(System.in); System.out.printf("Enter minimum number: "); …

Member Avatar for gahhon
0
183
Member Avatar for jezer08

I have 3 class, 1 for abstract(named Voter) ,1 for the gui components(named LayOut) and 1 for main(named Election). On my main I created an object of the gui class and set the visibility to true and the usual stuffs. but the problem is, on my main I have a …

Member Avatar for JamesCherrill
0
159
Member Avatar for suslady

import java.util.Scanner; class Calculator{ public static void main (String [] args) { Scanner suslady = new Scanner(System.in); int fnum, snum, remander, answer; char operation; System.out.print ("Enter 1st # "); fnum = suslady.nextInt(); operation = suslady.nextChar(); System.out.print ("Enter 2nd # "); snum = suslady.nextInt(); if(operation == '+') { answer = fnum …

Member Avatar for suslady
0
284
Member Avatar for carmzy

I'm can you help me how to count my username and password using an array. I confuse where should I put my counter inorder to up to 5. Hope your Positive response..... here is my code: [code] String[] username=new String[5]; String[] password=new String[5]; public void actionPerformed(ActionEvent e) { if(e.getSource().equals(btnAdd)) { …

Member Avatar for NormR1
0
100
Member Avatar for PearlLV88

import java.util.Scanner; public class Exercise3_1 { public static void main (String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter three edges: "); int integer = input.nextInt(); int edge1 = 1; int edge2 = 1; int edge3 = 1; // First condition: edge1 + edge2 should be greater than or equal …

Member Avatar for NormR1
0
170
Member Avatar for ilovejava

i have to write a program that displays the value of pi for values for i = 10000,20000.....,and 100000 i have to use the following series pi = 4(1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11_+...+(1/(2i +1))-(1/(2i +1)) any ideas i have to do a program with looping i cant use arrays can someone give me a …

Member Avatar for NormR1
0
1K
Member Avatar for lse123

I GUESS THIS IS ERROR - CAN YOU CONFIRM? "You can send an ImageIcon object as the Image argument that drawImage() expects." T/F "To start playing the AudioClip, you need to call the start() method on it." T/F // On the obj mean here?

Member Avatar for mKorbel
0
198
Member Avatar for Feriscool

I'm getting a null pointer exception on lines 17, and 22. I'm not positive, but does it have to do with "int number1 = data[0];" having to be static? [CODE]int number = 100; public static final int[][] NUMBERS = { { 1205, 1206 } }; public static boolean method1() { …

Member Avatar for mKorbel
0
195
Member Avatar for sohiabmaroof

hi all i m facing problem populating jtable with the data of database !m using arraylist to populate jtable .but the problem is that m unable to add databse data into jtables.i m only getting the last row elements of databse. i should be getting this data in the jtables …

Member Avatar for sohiabmaroof
0
190
Member Avatar for Dorar

[COLOR="red"]This is Reservation program full code written in JAVA <from the web> No Problems are in running process. I'm required to convert it to C language.[/COLOR] -- [COLOR="Green"]1- these are lines that i did not understand it. <could any one explain>[/COLOR] a. private static DataInputStream k = new DataInputStream(System.in); //what …

Member Avatar for Dorar
0
228
Member Avatar for keeda

Hi, I have to use Java to build a scrapper, that takes a product name and searches for that product on an e-commerce website. I understand that I will have to use an external library that would parse the html page for me, given the link. But how do I …

Member Avatar for ~s.o.s~
0
184
Member Avatar for lbgladson

I have a problem to determine Easter Sunday based on the algorithm invented by Carl Friedrick Gauss in 1800. I have written my code and double checked the Math several times but not matter what year I type in it tells me that Easter is on April 9th so I …

Member Avatar for Taywin
0
285
Member Avatar for sha11e

If I need a string or an int from the user, how can I make sure that that is what they inputted? The lame way of putting EVERYTHING in strings and then somehow check? Or maybe throw-catch? I tried the try-catch but had a few problems. The examples I saw …

Member Avatar for NormR1
0
295
Member Avatar for sahilsinghi

i tried to make a executable jar file.a program as follows [CODE]import java.io.*; class studentmarks { String name; double engmarks,phymarks,chemmarks; double tot,avg; public studentmarks(String s,double p,double e,double c) { name=s; engmarks=e; phymarks=p; chemmarks=c; } void compute() { tot=engmarks+phymarks+chemmarks; avg=tot/3; } void display() { System.out.println("nameis:"+name); System.out.println("totalis:"+tot); } }[/CODE] i saved it …

Member Avatar for hfx642
0
180
Member Avatar for madoman10

I am trying to prompt the user for a series of Integers and stop when the user enter a negative number and i am trying to add the number the users entered in a linked list. I was thinking about using the scanner class but i am having problems with …

Member Avatar for Taywin
0
76
Member Avatar for sathya88

how to send mp3,avi(large) files via socket...small files with size less than 100kb is possible but how to send large file..

Member Avatar for NormR1
0
8K
Member Avatar for nikelin

Simple resources loader tool which help to find some file in classpath and load it's content with respect to sanitizing policies.

Member Avatar for JamesCherrill
0
395
Member Avatar for hszforu

i have to convert a string into ascii format and then into it's binary. I know how to convert between int to binary using toBinaryString, so how to convert ascii to int. Or is there any other way to convert string characters into binary form. In short suppose there is …

Member Avatar for hszforu
0
808
Member Avatar for kevvek

How do i write these in a flowchart: ConverterMenu1 cm1 = new ConverterMenu1(); CurrencyConverter cc = new CurrencyConverter(); MeasurementConverter mc = new MeasurementConverter(); Please help me quick!

Member Avatar for NormR1
0
213
Member Avatar for Feriscool

This is giving me a nullpointerexception: [CODE] public static final int[][] ARRAY = { { NUMBERS } }; public static boolean method1() { for (int[] data : ARRAY) { int numberOne = data[0]; } if (numberOne != numberTwo) { method2(numberOne); } } public static boolean method2(int number) { int count …

Member Avatar for JamesCherrill
0
149
Member Avatar for lynnb86

I have all my code done, but it keeps saying no suitable constructor found (close to the bottom on the first code- ProduceInfo pInfo section- line 150) and cannot find symbol (line 62). I have read over this code, searched the errors on the net, and watched videos to try …

Member Avatar for lynnb86
0
157
Member Avatar for janice91

Dear Experts, I am new to the LinkedList concept and trying out coding a LinkedList problem which require me to do Insert newInteger based on the Index, Remove Index and Change oldInteger to newInteger based on Index. Please kindly advice what i should code in my [code] public void insert(int …

Member Avatar for Taywin
-1
185
Member Avatar for ankit.pandey3

[CODE]import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.TimerTask; /** * @author Adrian BER (beradrian@yahoo.com) */ public class PopupAnkit extends JPanel implements ActionListener{ private JToggleButton invokePopupButton; private JFrame popupWindow; Statement stmt=null; ResultSet rs=null; // int tempCount=0; public static int count=0; /** * Constructor. …

Member Avatar for ~s.o.s~
0
417
Member Avatar for BuhRock

So I created my ArraySet class from an interface. I'm trying to test my union method in my SetApp class, and I truly don't know where to begin. Can someone push me into the right direction? Btw, I know my SetApp class is messy atm, but I was just testing …

Member Avatar for ~s.o.s~
0
377
Member Avatar for manjushreekaran

i want to write a java code that prints the value for xml tags from database in java??? which method is suitable for this??? currently i can able to print <company comp:loc=" "/> here i need to get value for loc=" "... how can i achieve this???

Member Avatar for leiger
0
104
Member Avatar for archie.herbias

Can you suggest a program that i can submit? I need your help for suggestions.. any programs that involves GUI.. simple programs could be.. Thank you!

Member Avatar for leiger
0
225
Member Avatar for gayathriselvam

I hav given the name of file as class name and saved it as .java by creating a folder in c drive.when i try to compile it shows the following exception.pls help me to resolve from this problem C:\Program Files\Java\jdk1.7.0\bin>javac HelloWorldApp.java javac: file not found: HelloWorldApp.java Usage: javac <options> <source …

Member Avatar for leiger
0
191
Member Avatar for mitchiexlolz

I am currently making my project and it involves graphing functions. I have chosen Java because as I have surfed the net, i was able to download a library (JGraphT) that tells me that it can help me graph mathematical functions. Now, my problem is, i dont know how to …

Member Avatar for leiger
0
120

The End.