32,199 Topics
| |
[CODE] coordinates1[i][0]= Double.parseDouble(text2.substring(30,38));//X coordinates1[i][1]= Double.parseDouble(text2.substring(38,46));//Y coordinates1[i][2]= Double.parseDouble(text2.substring(46,56));//Z [/CODE] How do I combine the above 3 into 1 2D array? | |
Is it possible to call a constructor if we entered know value in the output screen ??? example !! [CODE]import java.io.*; class Employee{ int num; static int count=0; float compensation; public void print(){ System.out.println ("Employee number: " + num + ", Employee Compensation: $" + compensation); } public Employee(){ num … | |
hi , i am trying to develop one jsp application with tag concept on netbeans tool. but i am getting this error "According to TLD or tagfile, Attribute uri is mandatory for tag dbquery " . i could not run my application due to this error. In Jsp file i … | |
Hi, I have a doubt in overriding the methods in java. Sample program For overriding .This program executes fine. [code] import java.io.*; import java.util.*; class one { public void show(){ System.out.println("I am in class one-Super Class"); } } class two extends one { public void show(){ super.show(); System.out.println("The subclass two"); … | |
Alright, Ive moved onto my next mission. I have to draw a set of four triangles using for loops. I have the first two done, the second two have to have spaces prior to printing the asterisks. example: ***** **** *** ** * * ** *** **** ***** This is … | |
Hi all...i'm currently trying to manipulate strings from tokens. may i know how to eliminate a char from a token without splitting it?Below is some code that i tried.How can i eliminate a certain word after the tokens are set? [CODE] package autotextsum; import java.util.*; import java.util.StringTokenizer; public class AutoTextSumm … | |
Why this code fails.... ? [CODE] String a = "abcd/dgws"; a.replaceAll("/", "\\"); [/CODE] it results in ...... Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(String.java:558) at java.util.regex.Matcher.appendReplacement(Matcher.java:696) at java.util.regex.Matcher.replaceAll(Matcher.java:806) at java.lang.String.replaceAll(String.java:2000) | |
Assumming that program name is "XML.java", I need to perform the followings for each input file in command line--without running the code for every test file: java Xml < input1.txt java Xml < input2.txt : So My Code IS: [CODE]BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));[/CODE] [CODE]String fileName = bf.readLine();[/CODE] [CODE]File … | |
I am trying to assign variables in my array diveScore using a for-each loop. However, I don't understand why it isn't working and every element is 0.0 after the loop has ended. Eclipse is showing no errors so I am sure there is something wrong with my logic. Thanks. [code=java] … | |
I've a assignment question, A point on two dimensional plane can be represented by two numbers: an x coordinate and y coordinate. Eg (4,5). The sum of two point can be defined as a new point whose x coordinate is the sum of the x coordinates of two points similarly … | |
Hi i want to write bluetooth base app for send and recive string between two device . i have problem . i send string from device A and device B recive it but when i try to send answer from device B to A i get this notifier : [QUOTE]javax.bluetooth.BluetoothExeption: … | |
[B]what will be the query for ms access table to update a specific row? Code below is not making a valid result set resulting in exception? need help[/B]:-/ [CODE] import java.sql.*; class OdbcAccessQuery { public static void main(String [] args) { Connection con = null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = … | |
Im trying to make it so that my menu options that i've highlighted are their own method but i was having issues with returning them so i could use the selection as an int for my switch statement.Any ideas? [CODE]import javax.swing.JOptionPane; public class ConversionProgram { /** * @param args */ … | |
[B]somebody please tell me why im not getting String(X) value as ID,Name,FName are being printed on console correctly but the name of ID(4) from my DB_table is not going into string(X); [/B] [CODE] package gym.resources.busyicons; import java.sql.*; class OdbcAccessQuery { public static void main(String [] args) { Connection con = … | |
This is the assignment: Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user's selection from a menu of available mortgage loans: - 7 years at 5.35% - … | |
Dear All, I am new to hibernate. Please help me out in solving the following error: [Fatal Error] :5:2: The markup in the document following the root element must be well-formed. C:\Documents and Settings\Neetu.Khanna\My Documents\NetBeansProjects\HibernateExp\nbproject\build-impl.xml:584: Deployment error: Tomcat configuration file C:\Documents and Settings\Neetu.Khanna\My Documents\NetBeansProjects\HibernateExp\web\META-INF\context.xml seems to be broken. Please make … | |
This is the program in java which is an interface to stanford postagger. I have attached a copy of it. I am using netbeans 6.7.1 . I have placed the model file which is "left3words-wsj-0-18.tagger" in the bin folder of jdk and also placed the stanford-postagger.jar in that folder. I … | |
Hi Guys I wonder if you can help me get my head around this. I am trying to search a String for a sub string but there are not gaps in the original string for example [code] String s1 = "www.google.com/search/" String s2 = "google" [/code] when i attempt to … | |
I want to add the created textfields to an array by default. Is there any configuration for the editor of NetBeans or I need to code it to take all separate components to an array. Thanks :) | |
Hi , I am having a hashtable which consists of some keys and values.I can able to get the information from the hashtable using iterator or Enumeration. [code] import java.util.*; import java.util.Hashtable.*; import java.util.Iterator.*; import java.util.Enumeration.*; import java.io.*; class ex_hashtable { public static void main(String args[])throws IOException{ Hashtable<Integer,String> hobj=new Hashtable<Integer,String>(); … | |
I am a new learner of Java. Thq question is "Write a Java program ShowStars.java so that java ShowStars numA1 numB1 .... display a sequence of stars "*", starting from position numA1 and ending at position numB1. If there are further such integer pairs, say, numA2 and numB2, do the … | |
guys........ can anybody help me in FUNCTRIONS?? i'm not able to understand it. can u show me examples also???????? pls:icon_confused: :cool: pls reply............. thankyou.........:?: | |
i want to know that.. i hava a small java program i.e to caliculate electricity bill(home or commercial). i have compiled and executed it. so now i want to turn this program to a appilcation like caliculator. How?. | |
I keep getting these errors when I try to run the program Exception in thread "main" java.lang.NumberFormatException: For input string: "GTR" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at Inventory6.addProductToInventory2(Inventory6.java:549) at Inventory6.main(Inventory6.java:734) I've spent hours trying to figure out what I'm doing wrong and it's due in a few hours. I … | |
im trying to figure out how to get the max and min of the values that are entered if i run this program. I want the user to enter in a series of numbers until they were finished and to terminate it to type -99. I'm having quite a few … | |
I already have a Please Press Enter to continue... Statement for the end of my list that will allow the list to stay on the screen, be read, then when the user is ready they hit enter and the list continues to the next page. That is part of the … | |
See the code below, [CODE]import java.io.*; class Test1 { public static void main (String arge[]) throws IOException { InputStreamReader values = new InputStreamReader (System.in); BufferedReader br = new BufferedReader (values); String value,store; char ch; System.out.print ("Input String: "); value = br.readLine(); store = ''; int ln = value.length(); for (int … | |
how do i store a .bmp image or a .jpg image in a table in MS Access database? | |
Hello everybody!!! Can someone help me on how to create an executable file on java? I made some applications in java but my problem is, I need to compile my program everytime I want them to run ... What I want is to compile my program once and then just … |
The End.