4,084 Posted Topics
Re: set value for each correct answer to 1, for each false answer to 0 and set at each time you enter a sollution: int total += answerValue; | |
Re: it would also be good practice to try and understand why you need escape characters there, and why you can't just replace the \ and " chars. | |
Re: you propably forgot to reset a value you use to perform the calculation. | |
Re: [QUOTE=hfx642;1597280]Windows already has this built into the operating system. They are call "User Accounts".[/QUOTE] the OP never said he is using windows. well, I assume it is possible to write a login app that runs on starting up the computer, that asks for a login and hides everything else untill … ![]() | |
Re: shujin: besides the fact that this is a two year old thread... this is not a "gimme codez" forum. do some work yourself. | |
Re: can't explain any of that .. maybe when you show us your code, we'll be able to 'shine a light' on it, but just out of the blue ... nope, can't help you there. | |
Re: what do you mean "configure textpad"? are you talking about the configurations you need to do to be able to write java programs in notepad? there is no configuration needed. you need to install a JDK (Java Development Kit). you can find this at [URL="http://www.oracle.com/technetwork/java/javase/downloads/index.html"]Oracle's download section[/URL]. After that, you … | |
Re: tons of differences ... for instance: [Code=Java] double[] var = {15.0, 0.0}; [/Code] creates an array of two doubles. your length is fixed, so, don't ever try to add a third element. a List on the other hand will automatically add room for more elements if you add one too … | |
Re: because the OP hasn't marked it as "solved" yet. | |
Re: pretty sure packing it in a jar file would increase running speed :) all fun aside, as NormR1 mentioned, show your code. we can't just go around and unzip-install-compile and run the entire project for everyone who posts a question about their code. their are several reasons why your code … | |
Re: > start quote: import java.util.Scanner; public class Dia2{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.print("Please Enter a Number: "); int num = input.nextInt(); System.out.println(); //this is the first shape which start from top to bottom for(int i = 1; i <= num ; ++i){//how many rows … | |
Re: [QUOTE=akasekaihime;1593335]can you help me correct my java code......I do not know what is wrong with it... [/QUOTE] [CODE=Java] public static void main (String args[])throws IOException [/CODE] don't do this. where exactly do you think you're throwing this exception to? look at it as being a war: the main method is … | |
Re: how do you expect us to know this? what's the contents of the file, what do you expect to get, what are you getting, do you get error messages, ... just skimmed your code ... I think I know what your problem is: change [Code=Java]int inFile = 0;[/Code] into [Code=Java]String … | |
Re: ArrayIndexOutOfBoundsException means that you try to assign - read an element of an array that doesn't exist. for instance: [Code=Java] int[] intRow = new int[5]; intRow[5] = 5; [/Code] this will throw an ArrayIndexOutOfBoundsException, since you're trying to assign an element (intRow[5]) that doesn't exist. the row just has 5 … | |
Re: and what exactly do you mean: 'object extraction in a video shot'? | |
Re: Oracle provides you with a basic yet solid step-by-step tutorial on how to write an applet, right [URL="http://download.oracle.com/javase/tutorial/deployment/applet/"]here[/URL]. | |
Re: I agree with JamesCherrill here, but maybe one thing I would add as a posibility for beginners: Notepad++ => this allows you to have several files open at the same time, by using tabs. a lot easier to switch between them than switching between different screens. | |
Re: jep, printing seems (one) of the logical mistakes he made. also, the fact that he forgot to replace the standard values of his instance variables with the values he provides through the constructor, but you've already changed that. @newcuser: just taking a wild guess here: when you're printing your elements, … | |
Re: it basically decides who can access the method. public -> everyone protected -> package level and subclasses | |
Re: another approach would be: 1. set int age to -1; 2. input age; 3. if age < 0 no age or invalid age given by user else run application | |
Re: to write quality code: if you're familiar with the OO concepts and the java syntaxis, make an analysis of what you want to make. as JamesCherrill suggested, UML would be thĂ© way to go. once you have this, you should be able to get a clear view of what and … | |
Re: that error means you've given an invalid length for your arrays. you're trying to access an element of an array that doesn't exist. for instance: [CODE=java] String[] arr = new String[3]; // create a String array which will be able to hold 3 elements, being: // arr[0]; the first element … | |
Re: yes, this is possible, maybe you're not calling it the right way. | |
Re: what OS are you using? if you're using Windows, look at [URL="http://wso2.org/project/wsas/java/1.1/docs/setting-java-home.html"]this[/URL] for a basic and easy tutorial to set your environment varialbes, otherwise, or if you want another way to set them, take a look at [URL="http://jonas.ow2.org/doc/tutorial/src/html/configuration.html"]this[/URL]. | |
Re: not even taking the time to post the entire assignment? this must be "really urgent"... | |
Re: you need to remove one '}' right before your main method. you've closed your class before you started your main method, which is why it can't be found. | |
Re: or, you could realise that a jar file IS an executable file. just stick to the .jar file, instead of creating an exe file. why doing this? an exe file is a windows-executable file, which won't run unless the user is running windows as an OS. by just keeping the … | |
Re: you could take a look at [URL="http://www.jguru.com/faq/view.jsp?EID=123229"]this[/URL] | |
Re: [QUOTE=harinath_2007;1589926] If you are very good in java basic concepts , then try to prepare for Sun certified java programmer (SCJP) from now onwards...[/QUOTE] off course, SCJP does no longer exist. the name has been changed when Oracle took Java over from Sun. well ... actually, the most known 'contests' … | |
Re: [QUOTE=ssdeep;1589949]if i have information like this a->b->c->d->MESSAGE,how do i tokenize it such that i get a,b->c->d->MESSAGE from the original string???????????[/QUOTE] well ... if you used a StringTokenizer here, with "->" as separator, you wouldn't. you would get {"a","b","c","d"} now ... what exactly do you need? do you need the first … | |
Re: [QUOTE=bangor_boy;1581361]Learning about Abstract classes and interfaces, is there anything else I have forgotten about? [B]Abstract Class[/B] 3.Abstract methods with no body 4.A class extending the abstract class does not need to use all the abstract methods from the abstract class. [/QUOTE] a few remarks here: 3. just because the class … | |
Re: what exactly do you want help with? do you want us to check your code for errors, than please post your code. I'm pretty sure you understand the concept of intrest and percentage, so you should be able to work out the logic on yourself. | |
Re: too late :) just read up the previous post | |
Re: well .. you have String values of your input in your String args. so, considering you calling methods in the same class as your main method, I would assume you have two possible solutions: 1. you create a couple of static class variables, in which you store the values you … | |
Re: for a SERVER -> you have (for instance) tomcat, jBoss, resin, ... SERVLETS are java objects which (usually) extend HttpServlet, which you write yourself. now, how extended is your knowledge of overall java development? if you have some what a base to start on, I'm sure you'll find enough resources … | |
Re: that'ssss great. but why not allow him to learn something? don't just hand out code, provide him with tips. not to mention that you're comparing chars in your sollution, where the job description would rather suggest an integer. since the OP has trouble printing lines and checking for the right … | |
Re: not to mention overwhelm poor first-time developers. where in the description does it say there is sorting or anything as such needed? all you need to do is enter three integers, and store the smallest and largest and display these. a simple comparison between two integers is more then sufficient … | |
Re: to check for the equality of objects, you don't use the '==' operator, but you use the .equals method. | |
Re: [QUOTE=aiwasen;1582806] please help me to program this in java!![/QUOTE] [Code=Java] public class Test{ public static void main(String[] args){ System.out.println("this"); } } [/Code] et voilá, 'this' has been programmed in java!! now ... be a nice boy, and stop spamming this forum. considering the date, I assume the year is comming … | |
Re: @hfx642 All the questions the OP could have about starting with Java are answered in (as masjiade suggested) the first thread in this forum. no need to copy them in here. | |
Re: a quick glance, you have some big issues in there. for instance, in order for us to understand completely, you should best hand your entire code, so don't forget the Printer class. secondly, what do you expect to achieve by doing this? [Code=Java] Printer[] myPrinter = new Printer[5]; for (int … | |
Re: first remark: why do you put in two times the logic to print that asterisk figure? you could do something like (just the logic, not in Java syntax :P) boolean repeat = true; while repeat{ drawFigure(); print( "do you wish to draw again(Yes/No)") repeat = answer; } but, to go … | |
Re: No sowmya.m, we won't. 1. if you have a question, create a thread, don't revive one that 's been dead for a few years 2. put some effort in it. we're here to help you improve your code and to help solve errors you get, not to deliver custom-code, we're … | |
Re: well ... are you studying it, or are you following a course which expects you to study it? these questions handle the basics of the basics ... if you get this ten questions as a test, and don't pass ... well ... no offence, but if you don't get at … | |
Re: [Code=Java] int [] den=null; [/Code=Java] this is why ... before you want to set values like this: [Code=Java] den[i]=denom; [/Code] you have to set a length for the array, for instance: [Code=Java] int[] den = new int[5]; // creates an int - array with 5 elements [/Code] this 'll also … | |
Re: bhartman21 - you might want to read the last message posted before you submitted yours. | |
Re: well ... as JamesCherrill suggested: READ the message, don't just copy paste it. Expected class javax.xml.bind.annotation.XmlAccessType but found class javax.xml.bind.annotation.AccessType there 's your problem |
The End.