32,204 Topics
| |
Write a program, when given an array of integers, it returns the biggest integer. Can you please tell me what's wrong in this program?? [CODE]import java.util.Scanner; public class Arrayint { public static void main(String[] args) { Scanner input = new Scanner(System.in); int i,index,max; int x; int[] list=new int[x]; max=list[0]; System.out.println("Enter … | |
Hi, does anyone know a free windows explorer type of project written in java? Basically i just want to implement a simple windows explorer but dont want to start from scratch with all the drag and drops and so on. Thanks | |
Hi, I am working to call java script function from java program. I am able to do with simple javascript functions like below: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval("function printHello(Str) { print('Hello World') } printHello('Hello World')"); But not able to do the javascript function which includes … | |
i am truly a beginner.please can anyone assume and help me define main method in this parameterized constructor programme [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() … | |
I am having problems figuring out how to get the results from the strings and then give myself the option to sort through them alphabetically (or numerically). I have the code to the point where it shows the input data but don't know where to go from there. I'm fairly … | |
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 == … | |
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 … | |
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: "); … | |
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 … | |
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 … | |
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)) { … | |
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 … | |
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 … | |
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? | |
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() { … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
how to send mp3,avi(large) files via socket...small files with size less than 100kb is possible but how to send large file.. | |
Simple resources loader tool which help to find some file in classpath and load it's content with respect to sanitizing policies. | |
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 … | |
How do i write these in a flowchart: ConverterMenu1 cm1 = new ConverterMenu1(); CurrencyConverter cc = new CurrencyConverter(); MeasurementConverter mc = new MeasurementConverter(); Please help me quick! | |
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 … | |
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 … | |
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 … | |
[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. … |
The End.