No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
47 Posted Topics
Re: It's simple. Before displaying that number check whether it an even number while( num3 <= 377){ //loop ends after calculating the first 15 fibonacci numbers num3 = num1 + num2; if ( num3 % 2 == 0 ) System.out.println(num3 + "*"); num1=num2; num2=num3; } not after displaying No need for … | |
Re: Hi , You must have a condition to break the recursive call. That is if that condition meets it should not call itself. | |
Re: Hi, You are "==" operator which checks either sides of references points to the same object . That is checks the memory location [B]not the contents [/B]. So use equals() function to check the contents( "X" in your case)of the String object . Try to check the value("X") using looping … | |
Re: Hi , Try requestFocus() method | |
Re: [QUOTE=jasimp;768293]That's what javaAddict said, Java does not have multiple class inheritance, you can only only extend (is-A) one class. However you can implement (has-A) any amount of interfaces you want.[/QUOTE] Hi Sriran1 , what jasimp said is correct expect that implementing a interface is *NOT* mean "Has-A" relationship. Has-A relationship … | |
Hi all, I have searched about difference between KeyPressed and KeyTyped Events but still I'm not clear about that . One thing I have found is Keypressed is triggered first than KeyTyped . Please clarify me when these are triggered exactly . Which is appropriate to use for which purpose … | |
Hi all , I'm trying to display currency in Indian format but I'm getting question marks symbols instead of digits . Please tell me how to sort out this problem . Thanks in advance | |
Hi all , I'm trying to do find and highlight program which finds a given word by highlighting it in the textarea. I'm finding the word in a textarea which has both vertical and horizontal scrollbars .if the word is with in the visible area everything is fine but if … | |
Re: Hi torbecire , [QUOTE]Does Maze N = new Maze(row, col) do anything. I know it's supposed to set it as the length of the maze, and width, but the M = new MazeCell [length][width] confuses me.[/QUOTE] [B]Maze N = new Maze(row, col)[/B] Above line constructs Maze object . It has … | |
Re: Hi seang85, I don't want to do your homework but here is where going wrong . [QUOTE]System.out.print(Integer.parseInt("popsize[i][j]",2));[/QUOTE] There is a build in function to ease your work .Try to find it . | |
Hi all , I'm new to Networking programming in JAVA .I want to send messages across hosts which are in the same Domain without using any Server program . I'm not clear whether to use UDP or TCP . Give me some ideas and links which are useful to accomplish … | |
Re: Hi Loreto, Since I assume you have tried your best here is my help. If you are serious about programming please don't just do copy and paste work instead [B]Understand and use this snippet. [/B] [CODE=java]import javax.swing.*; public class SortDemo { static int arr [] ; static int i; public … | |
Re: Hi curt22 , It's best practice to separate event handling method from the event source class(class which contains UI widgets). So that later it will be easy to change that without affecting event source class. Consider this example : [CODE=java]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class SwingMenu { // … | |
Hi all , I had created a Document using jTextPane which I will use as a Template to create customize ones . For eg : I will create something like this in a Document using jTextPane Hi [B][I][U]<name>[/U][/I][/B] and I will open this Document in another jTextPane to replace <name> … | |
Hi da, Suggest me good books for Swing and JDBC(apart from Sun tutorials -which I will use) . I have basic knowledge of Swing which I read from Head First Java but I don't know anything about JDBC. Now I want to explore my knowledge in Swing and I'm going … | |
Re: Hi , In that program what you think are constructors are [B]not constructors at all[/B] . There are treated as methods since it doesn't satisfy constructor's rule and methods must have return type and that's why you are getting that error. To learn about constructor and how to create that … | |
Re: Hi , You don't have the reported methods(getID(),getAge(), setAge(int),setID(int)) definitions in Record Class. [QUOTE]C:\Project\Enrol.java:134: cannot find symbol symbol : constructor Record(java.lang.String,int,int) location: class Record database[size]=new Record(name,age,ID)[/QUOTE] and also you should have [B]Three argument constructor[/B] with appropriate types in your Record Class. | |
Re: Hi, Class definition should contain only variable and method declarations(and or definitions). Your while loops should be with in some function. | |
Hi all, I'm learning Serialization in JAVA . I learned that [B]"an array object is serializable as long as the things in the array are serilizable"[/B] . [COLOR=Green] I just need a clarification on that statement[/COLOR] . To understand that concept I myself coined a simple program . Here it's … | |
Hi all , [U]Here are my questions :[/U] I like to know when to use Serialization and when should the preference will be given to Database to persist an Object . To use a database with Java at what level a programmer should be good in Database ? what are … | |
Re: Hi , [QUOTE] invalid conversion from 'char' to 'const char*' initializing argument 1 of 'int atoi(const char*)'[/QUOTE] [QUOTE]int atoi(const char *number2)[/QUOTE] This function expects pointer as argument but you are passing a character . so pass the address of that character as [QUOTE]value=atoi(&number2[x]); [/QUOTE] | |
Re: Hi , [quote]switch (userChoice);[/quote] The problem is due to ';' at switch statement. writing [quote]switch (userChoice);[/quote] is same as [quote]switch(userChoice) { }[/quote] that is the case statements are [B]not [/B]belonging to this switch statement [B]where it should be[/B]. | |
Re: Hi , You didn't invoked that function(calculate) properly . | |
Re: [QUOTE]celsi = (5/9) * (fahren -32);[/QUOTE] The problem is due to type conversion. int/int will always yield int . | |
Re: Hi , [quote=nano404]int perimeter (x,y);[/quote] while declaring functions you need to [B]mention the data type[/B] with variable name(optional) but not just variable names. There should be a function definition which corresponds to declaration. greetings Parthiban | |
Re: If you used some text editor to create that file then make sure that it is not appended with ".txt" extension(or something else). type dir *.java in that directory and check that your file is listed | |
Re: Hi , [U]Here's the solution:[/U] [code=c]#include <stdio.h> #include <string.h> #define N_STRINGS 7 #define arrayword 15 #define maxletters 15 void sort_words(char[][15]); int main(void) { int i; char line[N_STRINGS][arrayword]; printf("\nPlease type in %d words : \n",N_STRINGS); for (i = 0; i < N_STRINGS; ++i) scanf("%s", line[i]); printf("\nHere is the list you entered:\n\n"); … | |
Re: Hi [quote=koolboy]I AM GETTING AN ERROR WHERE IT SAYS highest = NE[/quote] You decleared highest as "string" type but assigning float value to that . [inlinecode]highest = NE[/inlinecode] That's the problem I guess your intention is to output the highest number amoung the four.if it so, you have to decalare … | |
Re: Hi newbieGirl Here's the solution: [code=java]import javax.swing.JOptionPane; public class Summer { public static void main(String args[]) { int n; int product = 1; String input; do { input = JOptionPane.showInputDialog(null, "Please enter a number:", "Summer Program Input", JOptionPane.QUESTION_MESSAGE); }while("0".equals(input)); n = Integer.parseInt(input); for (int i = 1; i <= n; … | |
Re: Hi mariejt, [quote=mariejt]I am trying to create a Book2 object and assign to Inventory_Program6a. When I try the following: Book2 newBookTitle = Book2();[/quote] [inlinecode]Book2 newBookTitle = new Book2();[/inlinecode] The problem is you didn't declare default constructor in both Book and Book2 .So Simply add Book() and Book2() constructors in their … | |
Hi all , I tried one simple animation in Swing . Here's what the program has to do : when a button called "play" is clicked a circle should be moved from upper left corner down to the lower right corner. [code=java] import javax.swing.*; import java.awt.event.*; import java.awt.*; public class … | |
Hi all, I learned that "local static variable" with in a function is not allowed in JAVA as in C++. I guess it violates the rule of "static" as it's should not depend on objects but is there any alternative way avaiable to accomplish that ? (i.e scope is restricted … | |
Hi all, I'm a beginner in JAVA studying SWING. I learned that if we want to handle an event for a event source(say JButton) we should implement corresponding Event Listener(say ActionListener) . I also understood that we should register the Listener with that event source. With that knowledge I tried … | |
Re: Hi bapef , I don't know whether you are using array of character or string data type for 'name'. If you are using character array means get() function will help to get around this problem . Here's an example [code=c++]# include <iostream> using namespace std; int main(void) { const int … | |
Hi all , I have one doubt when i read a book to understand type conversion concepts . Here's the listing used in that book to demonstrate : [code=cplusplus]// strconv.cpp // convert between ordinary strings and class String #include <iostream> using namespace std; #include <string.h> //for strcpy(), etc. //////////////////////////////////////////////////////////////// class … | |
Hi all, I'm a beginner and I tried to write a program to convert celsius into Fahrenheit but i have a problem due to type casting operation. That is even though i explicitly converted an integer to float number I'm getting only integer value . Here's the program : [code]# … | |
Hi all, I tried one program to understand the concept of "Default Arguments" that program works prefectly in Dev C++ but not in Turbo C++ compiler(Ver 3.0). Here's my program [code]#include <iostream.h> #include <stdio.h> using namespace std; void justcall(char *c="Parthiban"); //char a[10]; //Global declaration needs for Turbo C++ Compiler void … | |
Hi all, I just started to work C++ in Dev C++ compiler before that i used Turbo C++ compiler when i try to compile a simple program in Dev C++ compiler . I'm getting error . Here's the program [code]#include <iostream> #include <conio.h> int main () { cout << "Hello … | |
Hi all, I'm new to J2EE programming. I have a simple doubt . I have already created a lookup method for EJB bean in Session bean . My question is how to call a method of an [B]ENTITY[/B] bean (say insertRow) from [B]SESSION[/B] bean method(Say invoke_insertRow) . Please provide me … | |
Hi all , I developed Entity Bean(BMP) and i created Deployment Descriptor in NetBeans 5.5. I'm getting following error . Error: === [code] XML validation started. Checking file:/G:/my_prgs/Xml/learning/Store_Data/build/jar/META-INF/jonas-ejb-jar.xml... Referenced entity at "[URL]http://www.objectweb.org/jonas/ns/jonas-ejb-jar_4_0.xsd[/URL]". schema_reference.4: Failed to read schema document '[URL]http://www.objectweb.org/jonas/ns/jonas-ejb-jar_4_0.xsd'[/URL], because 1) could not find the document; 2) the document could … | |
Hi all , I'm new to EJB Programming. I need your suggestion of which type of Entity bean i can use for my task . Here's the task i need to accomplish : ============================ I have data in XML now i need to store in SQL SERVER tables which i … | |
Hi all , I have an Standalone application client which pass excel/access file path(absolute) in to EJB server which will convert corresponding excel/access file in to XML. Till now i have hard-code an excel sheet path in application client but i need to make it to work for any excel … | |
Hi folks , I'm new to j2ee programming and using Netbeans 5.5 , i created a session bean program and deployed successfully in JOnAS application server but i'm not able to run the client program which invokes session bean (EJB module ). when i run client program i'm getting the … | |
Hi folks , I just started to learn J2EE using Netbeans(5.5) and JOnAS (4.8.4 ) . I tried to run a simple session bean(stateless) invoked through client application. I successfully deployed in jonas using Netbeans (5.5) but i can't able to successfully run it. Here with i attached client application(client2.zip) … | |
Hi all , I'm having problem during parsing xml files using DOM API due to whitespace characters. Here is my sample XML File ,coding and output : XML File : [code]<demo> <empid>e100</empid> </demo>[/code] Coding : [code]import java.io.*; import org.w3c.dom.*; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; class demo{ public … | |
Hi all, I have download Apache POI(2.5.1) to convert a Excel file to XML using NetBeans5.0 . After Unzipping i got three Executable JAR files 1.poi-2.5.1-final 2.poi-contrib-2.5.1 3.poi-scratch-2.5.1 Please tell what steps i have to do to install it (or) just it's enough to just point out that JAR files … | |
Hi all, I download JOnAS 4.8.4-tomcat5.5.17, APACHE Ant 1.7.0 and installed by setting JONAS_ROOT and ANT_HOME. When i check the environment using "jonas check" I'm getting following message [B]" The system cannot find the path specified. The system cannot find the path specified. JONAS_BASE is set to '-Dinstall.root' is not … |
The End.