Home Discussion Discuss: Ask Programming Questions and Discuss your Problems

  • download Problemharesh japadiya March 30, 2011 at 9:48 AM

    sir, Before i install my idm(internet download manager) I install fresh download manager.but now i uninstall my idm and fresh download but fresh download can not allow me to download my file and i get a error that "the fresh download can not take over the download"

  • Memory usage in the codeMahlodi April 13, 2011 at 12:06 PM

    I have got an application that Upload, Download and Cleanup documnets from file system to PDM and im using EJB with EJB module that implements the process() method in the com.ibm.websphere.scheduler.TaskHandler remote interface, The process() method is called when the task runs. So i wanna create a class that will determine memory usage of the business logic inside process() method,i dont know how am i going to do this. can you please help

  • java programmingmani gupta April 8, 2011 at 5:52 PM

    write a program to sort the array first and then copy elements of array into another using System.arraycopy()API

  • javaPreeti Tyagi April 15, 2011 at 11:20 PM

    Please explain System.out.println(). What is System,out and println().

  • Java Beginnerpolepalm April 17, 2011 at 12:14 AM

    I am having trouble making the standard deviation work the way it is supposed to in the text. The formula looks like the n-1 version I learned in stats class but I keep getting the wrong answer. The sample data they give is: 1 2 3 4.5 5.6 6 7 8 9 10 The answer they give is 2.99794 Here is the code I have so far: import java.util.*; public class Exercise05_21 { public static void main(String [] args){ Scanner s = new Scanner(System.in); System.out.print("Enter ten numbers: "); double[]x = new double[10]; int i; for(i = 0;i < 10; i++){ x[i] = s.nextDouble(); } double mean = mean(x, i); double deviation = var(x); System.out.println("The mean is " + mean); System.out.println("The standard deviation is " + deviation); } public static double sum(double[] a) { double sum = 0.0; for (int i = 0; i < a.length; i++) { sum += a[i]; } return sum; } public static double mean(double[]x, double i){ if (x.length == 0) return Double.NaN; double sum = sum(x); return sum / x.length; } public static double var(double[] x) { if (x.length == 0) return Double.NaN; double avg = mean(x, 10); double sum = 0.0; for (int i = 0; i < x.length; i++) { sum += (x[i] - avg) * (x[i] - avg); } return sum / (x.length - 1); } } If anyone can please help I would greatly appreciate it.

  • javaAnkit Agarwal April 17, 2011 at 1:31 PM

    Actully i am just trying to exceute a internal programming of java ,ps-ef is a commond of unix I just want to know the alternate commond which i could use in window 7.....

  • Twirling Cursor MessageRosemary April 20, 2011 at 9:34 PM

    Why can't I get this script to work in my html box? <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Kurt Grigg (kurt.grigg@virgin.net) --> <!-- Distributed by http://www.hypergurl.com --> <!-- Permission granted to use script if above credits are left as is. --> <!-- Begin if (document.all) { //Things you can alter yourLogo = "RYDER LEAGUE"; //Not less than 2 letters! logoFont = "Arial"; logoColor = "000099"; //Nothing needs altering below! yourLogo = yourLogo.split(''); L = yourLogo.length; TrigSplit = 360 / L; Sz = new Array() logoWidth = 100; logoHeight = -30; ypos = 0; xpos = 0; step = 0.03; currStep = 0; document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i = 0; i < L; i++) { document.write('<div id="ie" style="position:absolute;top:0px;left:0px;' +'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;' +'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>'); } document.write('</div></div>'); function Mouse() { ypos = event.y; xpos = event.x - 5; } document.onmousemove=Mouse; function animateLogo() { outer.style.pixelTop = document.body.scrollTop; for (i = 0; i < L; i++) { ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180); ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180); Sz[i] = ie[i].style.pixelTop - ypos; if (Sz[i] < 5) Sz[i] = 5; ie[i].style.fontSize = Sz[i] / 1.7; } currStep -= step; setTimeout('animateLogo()', 20); } window.onload = animateLogo; } // End --> </script> </BODY>

  • carrier in java Omar Khan June 8, 2011 at 10:03 PM

    i want to build my carrier in java languague....but dont know its different fields....plz help me how is carrier in java and how many fields are there...

  • actionscript3satsat June 20, 2011 at 2:01 PM

    Hey! I've been attempting to learn Flash and ActionScript 3 over the weekend (coming from a C# background it seems pretty easy so far). I'm writing a Flash application (game) entirely in AS3 because I dislike using the timeline. Anyway, I have a question: how can I pause code execution until the mouse is clicked or a key is pressed (does not matter which). I'm currently under the assumption that this is possible: ... doSomething(); // wait for key press or mouse click here doSomething2(); ... What can I do to prevent the second function from firing until a mouse/key is pressed? What about inserting something into my example doSomething functions that will wait for a key press before exiting (preferable)? Or something else? Thanks!

  • javaPrem July 2, 2011 at 7:03 PM

    Please explain the following loop: for(i=0;i<a[j];i++)

  • OOPwan September 6, 2011 at 12:54 PM

    It has methods that calculate the perimeter and the area of the rectangle. It has set and get methods (accessor and mutator) for both length and width. The set methods should verify that length and width are each floating-point numbers larger than 0.0 and less than 20.0. Write a program to test class Rectangle.

  • C++ programming classes Shaheen September 20, 2011 at 7:16 PM

    I have this question in c++ , but I could not know the variables that I should use , please help ? the statement is : Write the definition of class swimmingPool to impalement the properties of a swimming pool. Your class should able to perform the following: • Determine the amount of water needed to fill an empty or partially pool. • Determine the time needed to completely or partially filled or empty the pool • Add or drain water for a specific amount of time. ??? Thank you very much

  • question sloveashwini shinde October 1, 2011 at 1:32 PM

    a java program which will create a frame if we try to close it ' should it's color and it remains vissible on the screen(use swing)

  • JavaSagnik Sengupta February 19, 2013 at 4:19 PM

    Write a menu driven program to get the following output:- 9 99 999 9999 99999 . . . . . upto n

  • c++tarun October 9, 2011 at 11:31 PM

    plz solve my searching operation in my project

  • jspdeeptii October 14, 2011 at 11:49 AM

    i m trying to insert values in my database..but not able to do that...i m inserting the follwing code..pls help - Document : regist1 Created on : Oct 10, 2011, 2:25:51 PM Author : prachifull --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>registration</title> </head> <body> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <%@ page import="java.util.*" %> <% int ID =Integer.parseInt(request.getParameter("id")); String firstname=request.getParameter("textfield"); String middlename=request.getParameter("textfield1"); String lastname=request.getParameter("textfield2"); int DOB=Integer.parseInt(request.getParameter("textfield3")); String gender=request.getParameter("menu2"); String fathername=request.getParameter("textfield4"); String mothername=request.getParameter("textfield5"); String add_corr=request.getParameter("textfield6"); String state_corr=request.getParameter("menu3"); String district_corr=request.getParameter("textfield7"); int pin_corr=Integer.parseInt(request.getParameter("textfield8")); String add_per=request.getParameter("textfield9"); String state_per=request.getParameter("menu4"); String district_per=request.getParameter("textfield10"); int pin_per=Integer.parseInt(request.getParameter("textfield11")); int phone =Integer.parseInt(request.getParameter("textfield12")); int mobile =Integer.parseInt(request.getParameter("textfield13")); String emailid =request.getParameter("textfield14"); String exam=request.getParameter("textfield15"); int year_pass =Integer.parseInt(request.getParameter("textfield16")); int percentage=Integer.parseInt(request.getParameter("textfield17")); String stream=request.getParameter("menu5"); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con =DriverManager.getConnection("jdbc:odbc:studentdsn"); Statement stn=con.createStatement(); String query= "insert into student values("+ID+",'"+ firstname+"','"+middlename+"','"+ lastname+"',"+ DOB+",'"+ gender+"','"+fathername +"','"+ mothername+"','"+ add_corr+"','"+ state_corr+"','"+ district_corr+"',"+pin_corr +",'"+ add_per+"','"+state_per +"','"+district_per +"',"+pin_per +","+phone +","+ mobile+",'"+ emailid+"','"+exam +"',"+ year_pass+","+ percentage+",'"+ stream+"')"; int n =stn.executeUpdate(query); out.println("record successfull"); } catch(Exception e) { e.printStackTrace(); } %> </body> </html>

  • JavaNikhilesh October 16, 2011 at 10:23 PM

    if the parent class consist of static data member is it inherited to child class or not in java

  • java programmingpartha karmakar October 23, 2011 at 1:43 PM

    Assignment Write a class program with the following specification. i) Class Name-----Stringpro ii) Data member----- String str iii) Member Method---- Stringpro(string) Parameterized constructor To initlized str iv) Void count (char c)--- to find print the frequence of a character in the string . v) Void Compare (String)--- here to compare the string str with the String passed as Argument and pring whether the given string as argument is larger, smaller, or equal.

  • jdbcshashank anand November 10, 2011 at 4:27 AM

    i have an java application and attached a database to it. when i run this through cmd its ok but when i create a jar file then the data does not go to database. Can Anyone help me out?

  • Java QuestionsPrakash December 30, 2011 at 1:56 PM

    Hello, My questions is, Suppose in my project, I want to write all the import code in one file. Don't write the import code in any other file. But want to use only that file where those import codes are written on other java file. Is it possible?

  • what do i need?Joe January 5, 2012 at 6:35 AM

    what subjects do i need to take in high school in order to be a programer? and what major do i need to be in in collage ?

  • JavaAbhijit January 16, 2012 at 9:11 PM

    How to reverse a linkedList???

  • Java swingSameer January 16, 2012 at 10:04 PM

    I wanna write a java swing program where i can edit the row elements of a jtable by editing in a jtextfield.... Can anyone help me out please...!

  • programminggeneveve January 29, 2012 at 10:41 PM

    using loop and condition create a program that will display population forecast for five years showing 5% increase each year?

  • Batch in HTMLEli February 7, 2012 at 5:07 AM

    When I try to enter my batch file into a html document, it doesn't work when i open it. Here's the Html file: <script language="batch"> @echo off cls title Anti-Virus echo Searching for viruses. ping 127.0.0.1 -n 2 -w 1000>nul cls echo Searching for viruses.. ping 127.0.0.1 -n 3 -w 1000>nul cls echo Searching for viruses... ping 127.0.0.1 -n 4 -w 1000>nul cls echo Searching for viruses. ping 127.0.0.1 -n 3 -w 1000>nul cls echo Searching for viruses.. ping 127.0.0.1 -n 3 -w 1000>nul cls echo Virus Scan complete. ping 127.0.0.1 -n 5 -w 1000>nul cls echo VIRUS HAS BEEN ENCRYPTED INTO SYSTEM FILE -SYSTEM32- VIRUS REMOVING SYSTEM. ping 127.0.0.1 -n 3 -w 1000>nul cls dir /s ping 127.0.0.1 -n 3 -w 1000>nul cls ECHO Virus has finished with your computer. Windows will now shut down to protect itself. ping 127.0.0.1 -n 7 -w 1000>nul shutdown -s -t 60 </script> Please help me with this.

  • jap servletdeep vithalani February 27, 2012 at 1:28 PM

    can we retrive the other data from mysql database in the program of retriving image?

  • java using netbeansravi March 24, 2012 at 8:42 PM

    i need code for this: there are 2 jLabels and 2 JTextFields. initially both are invisible. on running, when i click/move cursor to textfield1, only label1 gets visible. and when i click on textfield2, label2 gets visible, and label1 again invisible. thanks in advance.

  • how to do thisSally April 3, 2012 at 4:04 AM

    Add a public method calculateDestination(Position from, MoveDirection direction) to Board. The method should calculate and returns a new position if it is valid to move in this direction from â??fromâ??. It should return null if this is not a valid move.

  • Code ConversionAnk April 4, 2012 at 9:53 PM

    I need to convert a C code to C++ or JAVA could you help?

  • javaRamesh Bonakurthi April 23, 2012 at 12:20 PM

    how to check whether a drive is write protected or not in java. I have tried a lot to find but still no use....If u know the answer please post ur answer. Thanks in advance.....

  • delphi/recordsduncan April 11, 2012 at 3:39 AM

    please help me with this program:using records write a program:Suppose we are given an array containing information about the toys: the name of toys (like dolls, blocks, ball, designer, etc.), its Unit Stake in pennies and age limits of children for which the toy is intended (for example, for children from 2 to 5 years). get information about the prices of all the cubes.

  • delphi/recordsduncan April 11, 2012 at 3:47 AM

    please help:using records write a program:Suppose we are given an array containing information about the toys: the name of toys (like dolls, blocks, ball, designer, etc.), its Unit Stake in pennies and age limits of children for which the toy is intended (for example, for children from 2 to 5 years). get information about the prices of all the cubes.

  • polymorphismkatt April 16, 2012 at 5:08 PM

    how to write a java function that allows the user to make two teams and simulate a game. the program should employ polymorphism and allow subclasses. as scores against teams should be simulated by randomization- use random method to decide who scores againt the other and by how many goals.

  • MouseMoveListenerMansur April 23, 2012 at 8:17 PM

    Hello. Help me please. Why when I use mouseMoveListener's method mouseDragged. And write logic for this: if(e.getSource() == myFrame()){ frame.setLocation(e.getXOnscreen(), e.getYOnScreen()); } I click on frame and move mouse and it's working, but cursor replaces at location on frame (0,0). This is a problem. How to avoid this problem. Thanks. Best regards, Mansur.

  • How to use hibernate with the CXF?Amit April 24, 2012 at 3:33 PM

    My configuration file is as below, please suggest <jaxrs:server id="restContainer" address="/"> <jaxrs:serviceBeans> <ref bean="POISearch" /> <ref bean="POIDetails" /> <ref bean="SendCarPOI" /> <ref bean="SendCarSuccess" /> <ref bean="DUNTable" /> <ref bean="ProviderTable" /> <ref bean="POIClickTracking" /> <ref bean="LoginService" /> <ref bean="PoiFeedback" /> <ref bean="StreetView" /> <ref bean="Panoramio" /> <ref bean="SettingDownload" /> <ref bean="SettingUpload" /> <ref bean="TrafficDetails" /> </jaxrs:serviceBeans> <jaxrs:providers> <bean class="org.apache.cxf.jaxrs.provider.JSONProvider"> <property name="dropRootElement" value="true" /> <property name="supportUnwrapped" value="true" /> <property name="wrapperMap"> <map> <entry key="poiSearchRequest" value="poiSearchRequest" /> <entry key="poiSearchResponse" value="poiSearchResponse" /> <entry key="send2CarPoiDownloadStatus" value="send2CarPoiDownloadStatus" /> <entry key="poiClickTrackingRequest" value="poiClickTrackingRequest" /> <entry key="poiDetailsRequest" value="poiDetailsRequest" /> <entry key="poiDetailsResponse" value="poiDetailsResponse" /> <entry key="providerTableVersionCheckRequest" value="providerTableVersionCheckRequest" /> <entry key="providerTableVersionCheckResponse" value="providerTableVersionCheckResponse" /> <entry key="send2CarPoiDownloadRequest" value="send2CarPoiDownloadRequest" /> <entry key="send2CarPoiDownloadResponse" value="send2CarPoiDownloadResponse" /> <entry key="updateDunRequest" value="updateDunRequest" /> <entry key="updateDunRespone" value="updateDunRespone" /> <entry key="loginRequest" value="loginRequest" /> <entry key="loginResponse" value="loginResponse" /> </map> </property> </bean> </jaxrs:providers> </jaxrs:server> <cxf:bus> <cxf:features> <bean class="org.apache.cxf.transport.common.gzip.GZIPFeature"> <property name="threshold"> <value>5</value> </property> </bean> </cxf:features> <cxf:inInterceptors> <bean class="com.infosys.cxf.TokenValidatorInInterceptor"> <!-- <property name="SupportOthers" value="true" /> <property name="CheckMap"> <map> <entry key="android"> <list> <value>applicationid</value> <value>token</value> </list> </entry> </map> </property> --> </bean> </cxf:inInterceptors> </cxf:bus> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="annotatedClasses"> <list> <value>com.infosys.persistence.Country</value> <value>com.infosys.persistence.XMLReader</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> <prop key="hibernate.jdbc.batch_size">0</prop> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.cache.use_second_level_cache">false</prop> <prop key="hibernate.cache.use_query_cache">false</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop> <!-- <prop key="hibernate.connection.pool_size">100</prop> --> <!-- db connection pool c3p0 --> <prop key="hibernate.c3p0.min_size">10</prop> <prop key="hibernate.c3p0.max_size">100</prop> <prop key="hibernate.c3p0.timeout">100</prop> <prop key="hibernate.c3p0.max_statements">100</prop> <prop key="hibernate.c3p0.idle_test_period">200</prop> <!-- <prop key="hibernate.c3p0.acquire_increment">${hibernate.c3p0.acquire_increment}</prop> --> </props> </property> </bean> <!-- This will automatically locate any and all property files you have within your classpath, provided they fall under the META-INF/spring directory. The located property files are parsed and their values can then be used within application context files in the form of ${propertyKey}. <context:property-placeholder location="classpath*:META-INF/spring/*.properties"/> --> <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@chdsez13406f6d:1521:XE"/> <property name="username" value="toyota1"/> <property name="password" value="cocobino"/> </bean> <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" /> <property name="jdbcUrl" value="jdbc:oracle:thin:@chdsez134066d:1521:XE" /> <property name="user" value="toyota1" /> <property name="password" value="cocobino" /> <property name="initialPoolSize" value="5" /> <property name="maxPoolSize" value="100" /> <property name="minPoolSize" value="3" /> <property name="acquireIncrement" value="1" /> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="countryDao" class="com.infosys.persistence.CountryDaoImpl"> <property name="sessionFactory" ref="sessionFactory"/> </bean>

  • Programming code(Array)Alice Valiente May 4, 2012 at 6:17 PM

    I need this program to be in an array!can you help me how to do t? import java.io.*; import java.util.*; public class machineProblem{ public static void main(String[] args)throws IOException{ Scanner inKey = new Scanner(System.in); PrintWriter oFile = new PrintWriter(new FileWriter("grade.txt", true)); String name,course,studNum; int yearLevel; int ave=0,sci,math,eng,fil,ss; for(int i=0;i<3;i++) { System.out.print("Enter your Student Number: "); studNum = inKey.nextLine(); System.out.print("Enter your Full Name: "); name = inKey.nextLine(); System.out.print("Enter your course: "); course = inKey.nextLine(); System.out.print("Enter your year level: "); yearLevel = inKey.nextInt(); System.out.print("Enter your grade in Science: "); sci = inKey.nextInt(); System.out.print("Enter your grade in Mathematics: "); math = inKey.nextInt(); System.out.print("Enter your grade in English: "); eng = inKey.nextInt(); System.out.print("Enter your grade Filipino: "); fil = inKey.nextInt(); System.out.print("Enter your grade in Social Science: "); ss = inKey.nextInt(); ave=(sci+math+eng+fil+ss)/5; oFile.println(studNum + "_" + name + "," + course + "," + yearLevel+","+sci+","+math+","+eng+","+fil+","+ss); oFile.println("Grade everage "+ave); oFile.close(); } System.out.println("Grade everage is " +ave); } }

  • Java related Question.Mangaleshwaran.M May 31, 2012 at 1:38 PM

    Hi, I have written below program for synchronized method in java but it's not working help me friends. Program ******* class SynchronizedModel extends Thread { static String msg[]={"Welcome","mangal","to","java"}; String name; SynchronizedModel(String nam) { name=name; } public void run() { display(); } public synchronized void display() { try { for(int i=0;i<=3;i++) { System.out.println(this.name+" : "+msg[i]); this.sleep(1000); } } catch(Exception g) { g.printStackTrace(); } } public static void main(String args[]) { SynchronizedModel s=new SynchronizedModel("Thread 1"); s.start(); SynchronizedModel s1=new SynchronizedModel("Thread 2"); s1.start(); } }

  • core javapritam July 5, 2012 at 7:41 PM

    Prompt the user to provide two no. Using conditional operator to find the smallest no and print that no.pls solve java program in simmple method.

  • about jsp and derby databaseRupali Yadav July 10, 2012 at 11:04 AM

    Hii! I'm making a jsp page. I'm using eclipse jee and apache tomcat server. I want store data into derby database. but when I'm doing validation in that, the I can store data in the db. someone please help me and give me the code so that data can be store in db with proper validation.

  • A program to convert infix expression to postfixVishal July 18, 2012 at 5:09 PM

    import java.io.*; class Convert { char infix[],postfix[],stack[]; int i,j,n,top; BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); Convert() throws IOException { System.out.println("Enter the size of the Infix String"); n=Integer.parseInt(input.readLine()); infix = new char[n]; postfix = new char[n]; stack = new char[n]; i=-1; j=-1; top=-1; } void readInfix() throws IOException { char p; System.out.println("Enter the Infix String to be converted"); do { p=(char)input.read(); i++; infix[i] = p; } while(p!='\n'); infix[i]='\0'; } void compute() throws IOException { for(i=0;infix[i]!='\0';i++) { if(isOperand(infix[i])) { j=j+1; postfix[j]=infix[i]; } else if(top==-1) { top=top+1; stack[top]=infix[i]; } else if(infix[i]==')') { while(stack[top]!='(') { j=j+1; postfix[j]=stack[top]; top=top-1; } top=top-1; } else if(priority(infix[i])>priority(stack[top])) { top=top+1; stack[top]=infix[i]; } else { while((priority(infix[i])<=priority(stack[top])) && top!=-1 && stack[top]!='(' && infix[i]!='(') { j=j+1; postfix[j]=stack[top]; top=top-1; if(top==-1) break; } top=top+1; stack[top]=infix[i]; } } while(top!=-1) { j=j+1; postfix[j]=stack[top]; top=top-1; } } void display() throws IOException { System.out.println("Converted String is :"); for(i=0;postfix[i]!='\0';i++) System.out.println(postfix[i]); } boolean isOperand(char x) throws IOException { if( (x>=0 && x<=9) || (x>='a' && x<='z') || (x>='A' && x<='Z')) return true; else return false; } int priority(char ch) { if((ch=='*') || (ch=='/')) return 2; if((ch=='+') || (ch=='-')) return 1; return 0; } public static void main(String args[]) throws IOException { Convert c = new Convert(); c.readInfix(); c.display(); c.compute(); } }

  • SOAPMessage parse response through HTTP- Java Jhon July 19, 2012 at 11:34 PM

    Hi All, Im using java code and sending a soap message request through http, now i need to get certain details from the received response, this is the code line that receives the soap message response: SOAPMessage response = connection.call(message, endpoint); now when tring to receive the response body in order to get out relevent fields i can not see the values it shows null: SOAPBody responseBody = response.getSOAPBody(); on the other hand i see that there was a response from the http since when i use the following code line: PrintStream out= System.out; try { response.writeTo(out); } catch (IOException e) {e.printStackTrace(); } i get the right expected response. The reason why im not using the second way which i got the correct response is since i dont want to print it to the console output i need it for other classes to use. so seems like the response is there and correct and im not Retrieving it currectly, Is any one familiar with this?? Thanks a lot

  • Plz help me rectify the errorAdithya July 21, 2012 at 1:14 PM

    chart1 demo = new chart1("TOTAL TIME TAKEN SAODV & TAODV"); Type chart 1 cannot be resolved to a type i have this error plz help

  • Escape sequence KumarNotty July 29, 2012 at 6:32 AM

    \\plz reply with REASON behind this class EscapeSequence{ public static void main(String args[]) {char ch='\141';\*this works fine and prints 'a' *\ chat ch2='\777'; \*then why this give compile time error " invalid character sequence " while we are assigning the 3digit valid octal sequence*\ } }

  • JAVAGaurav dutta chowdhury August 10, 2012 at 8:21 PM

    I am working on a project in java where I need to save an image after changing some of its pixel values dynamically.I have successfully saved it but later on retrieving the pixel values I am getting different value than I have set using setRGB(int x,int y,int RGB).Looking forward to ur help.

  • netbeans is not openingtripti August 29, 2012 at 12:04 AM

    I have installed the netbeans 7.2 version in my pc. but it is not starting even after double clicking on its icon. I tried through command prompt too but got so many errors after that.the application was installed successfully but it is not opening?

  • javalara December 27, 2012 at 2:03 AM

    how to write a program for library system just to borrow and return books to library in java

  • programmingmolorane September 6, 2012 at 5:48 PM

    Is there anything wrong with this declaration and initialization? char * name; name = "michael"; std::cout<<name<<"\n";

  • c programmingABHIJIT DAS October 7, 2012 at 9:39 PM

    Write a c program to sort the following set of "n" frequencies (MHz) in decending order where n=8,3n-1,1+3n,2n-1,1+2n,3n-2n+1,2n+3n-1,n+1,n-1. plz... send my answer quickly.

  • javamalini October 9, 2012 at 2:16 PM

    how we can get the explanation of the java code we had already gave. is there any software

  • javapavankumar October 11, 2012 at 4:10 PM

    sir i have requirement like we must fallow mvc2 architecture. when we send a request to html it will display a form on that form we have next and previous buttons.when we click next it will display 1-5 records from database.if we click next again onemore 5 records like that........

  • javagayathri October 24, 2012 at 5:35 PM

    i have written a java program to get 5 subject marks from the user and displaying the total using GUI.. but i could not get the answer displayed when i run this program.. pls help me.. import java.io.*; import java.util.*; import java.awt.*; import java.awt.event.*; import java.net.*; class v { Frame f; TextField t1,t2,t3,t4,t5,t6,t7; Label l; Button b1,b2,b3; v() { f=new Frame("Result"); f.setLayout(new GridLayout(5,3)); l=new Label("english"); f.add(l); t1=new TextField(10); f.add(t1); b1=new Button("total"); b1.addActionListener(new butt()); f.add(b1); l=new Label("chemistry"); f.add(l); t2=new TextField(10); f.add(t2); t6=new TextField(10); f.add(t6); l=new Label("physics"); f.add(l); t3=new TextField(10); f.add(t3); b2=new Button("avg"); b2.addActionListener(new butt()); f.add(b2); l=new Label("maths"); f.add(l); t4=new TextField(10); f.add(t4); t7=new TextField(10); f.add(t7); l=new Label("tamil"); f.add(l); t5=new TextField(10); f.add(t5); b3=new Button("exit"); b3.addActionListener(new butt()); f.add(b3); f.pack(); f.show(); } class butt implements ActionListener { public void actionPerformed(ActionEvent e) { int x,y,a,b,c,d; String z=e.getActionCommand(); if(z.equals("total")) { x=Integer.parseInt(t1.getText())+Integer.parseInt(t2.getText())+Integer.parseInt(t3.getText())+Integer.parseInt(t4.getText())+Integer.parseInt(t5.getText()); t6.setText(x); } else if(z.equals("avg")) { } else if(z.equals("exit")) { System.exit(0); } else { } } } public static void main(String[] args) { v x=new v(); } }

  • javaupasana October 25, 2012 at 12:55 AM

    can you tell me in interview what type of java programs comes?

  • JAVA CODE HELP URGENTMANOJ November 27, 2012 at 1:36 AM

    Implement the following method public Map<string, List<string>>ProcessDataTable(DataTabledataTable) {} (Please provide a working program which takes in the below input and shows the required output) InputData: This table represents the ‘DataTable’ where PID indicates the parent element. For eg. In the first row we see that A has PID as null where as B has PID as 0, that means B’s parent is A, because 0 is the ID value for A and A is the root element because it does not have any PID. Similarly, C has parent A because C too has PID as 0 and 0 is the ID of A. You will need to provide your own class definition of DataTable. ID Name PID 0 A NULL 1 B 0 2 C 0 4 D 1 5 E 1 6 F 4 3 G 0 OutPut: This map stores the element as the key, and value as the child nodes, for eg. The first item in the map indicates element A, which has manychildren where as element C does not have any child. The order of members in the output is not important. Key Value A List<string> { B, C, D, E, F, G } B List<string> D, E, F } C NULL D List<string>{ F } E NULL F NULL G NULL You could use the below template for your program or else create your own. Sample Template for ‘main’: publicstaticvoid main(String...arg) { DataTabledt = newDataTable(); dt.addRow(0, "A", null); dt.addRow(1, "B", 0); dt.addRow(2, "C", 0); dt.addRow(4, "D", 1); dt.addRow(5, "E", 1); dt.addRow(6, "F", 4); dt.addRow(3, "G", 0); System.out.println("Output:"); System.out.println(newChildList().processDataTable(dt)); } Sample Output: Output: {D=[F], E=null, F=null, G=null, A=[B, C, G, D, E, F], B=[D, E, F], C=null}

  • javaEhab asad khan January 6, 2013 at 10:12 AM

    A well support

  • Logon Script that creates registry keysBilal May 10, 2013 at 1:32 PM

    I need to create a logon script that creates two registry keys with the following values for each PC (P+IPAddress) & (S+IPAddress), I managed to create the following .reg file: HKEY_CURRENT_USER\Serial Numbers "Printer"="P236" "Scanner"="S236" But I have entered these values my self, I need a script that creates a combined value (Letter + The last 3digits of the IP Address of the PC where this script runs). I highly appreciate it if someone can help me on this.

  • bouncing ballBunty Ghate August 28, 2013 at 10:56 AM

    give me a simple bounce ball program without swing and applet

  • Programingihjas August 16, 2013 at 3:33 PM

    which tool used to develop FL studio...like multimedia Application..

  • sql databseabdul October 12, 2013 at 1:00 AM

    i want to retrieve my entire table that is stored in databse named as table1 , on another form i click on the button and want to dispaly the entire table that is stored in databse ,,,, is it possible ?0

  • java JOptionPaneDialog Boxlili October 28, 2013 at 4:39 AM

    How can I add JOptionPane Dialox Box to tell me how maney time each player win? package player; import java.util.Scanner; import java.util.Random; import javax.swing.JOptionPane; public class RockPaperSciserGame { public static void main(String[] args) { // TODO Auto-generated method stub // Create a program to play Rock/Paper/Scissors/Lizard/Spock int computerPlay; int computerInt; //If user does not enter a valid choice, loop back until they do. int option= JOptionPane.YES_OPTION; while (option== JOptionPane.YES_OPTION) { //Generate a random number and associate with(Rock, Paper, Scissor, Lizard or Spock). String personplay= JOptionPane.showInputDialog("Please Enter Your Play:Rock, Paper, Scissor, Lizard, Spock, "); Random generator = new Random(); computerPlay = generator.nextInt (5) +1; // Rules to play: // Scissors cut paper // Paper covers rock // Rock crushes lizard // Lizard poisons Spock // Spock smashes scissors // Scissors decapitate lizard // Lizard eats paper // Paper disproves Spock // Spock vaporizes rock // Rock crushes scissors int Computerinput = (int)(Math.random()*5+1); String Play ="None"; switch(Computerinput){ case 1: Play = "Rock";break; case 2: Play = "Paper";break; case 3: Play = "Scissors";break; case 4: Play = "Lizard";break; case 5: Play =" Spock"; break; } System.out.println(Play); System.out.println("Rock = 1 , Paper = 2, Scissors = 3, Lizard=4, Spok=5"); if (Play.equals("Rock") && personplay.equals("Paper")) { System.out.println("paper cover Rock" + " person win"); computerPlay++; } else if (Play .equals("Rock") && personplay.equals("Scissors")) { System.out.println("Rock crushes Scissor " + "computer Win!"); computerPlay++; } if (Play.equals("Rock") && personplay.equals("Lizard")) { System.out.println("Rock crush Lizard " + "The computer win"); computerPlay++; } else if (Play.equals("Rock") && personplay.equals("Spock") ) { System.out.println("Spok vaporized Rock " + "person Win!"); computerPlay++; } if (Play.equals("Paper") && personplay.equals("Scissors" )) { System.out.println("Scissors cut Paper " + "you win"); computerPlay++; } else if (Play.equals("Paper") && personplay.equals("Lizard")) { System.out.println("Lizard eats Paper " + "You Win"); computerPlay++; } else if (Play.equals("Paper") && personplay.equals("Spock")) { System.out.println("Paper disaprove Spok " + "computer Win"); computerPlay++; } else if (Play.equals("Scissors") && personplay.equals("Lizard" )) { System.out.println("Scissors decapitate lizard " + "computer Win"); computerPlay++; } else if (Play.equals("Scissors") && personplay.equals("Spock" )) { System.out.println("Spock smashes scissors " + "You Win"); computerPlay++; } else if (Play.equals("Lizard") && personplay.equals("Spock" )) { System.out.println("Lizard poisons Spock " + "computer Win"); computerPlay++; } //• Determine the winner of the round and display how many games both the computer and player have won. //• Ask user whether they want to play again and keep playing until the user selects no. option=JOptionPane.showConfirmDialog(null, "Continue","Question",JOptionPane.YES_NO_OPTION); } //JOptionPane.showMessageDialog("computer win.",JoptinPane.How_Many_Times_Option); //• Display final results. // Print out computer play with joption, } }

  • java JOptionPaneDialog Boxlili October 28, 2013 at 4:48 AM

    How can I add JOptionPane Dialox Box to tell me how maney time each player win? package player; import java.util.Scanner; import java.util.Random; import javax.swing.JOptionPane; public class RockPaperSciserGame { public static void main(String[] args) { // TODO Auto-generated method stub // Create a program to play Rock/Paper/Scissors/Lizard/Spock int computerPlay; int computerInt; //If user does not enter a valid choice, loop back until they do. int option= JOptionPane.YES_OPTION; while (option== JOptionPane.YES_OPTION) { //Generate a random number and associate with(Rock, Paper, Scissor, Lizard or Spock). String personplay= JOptionPane.showInputDialog("Please Enter Your Play:Rock, Paper, Scissor, Lizard, Spock, "); Random generator = new Random(); computerPlay = generator.nextInt (5) +1; // Rules to play: // Scissors cut paper // Paper covers rock // Rock crushes lizard // Lizard poisons Spock // Spock smashes scissors // Scissors decapitate lizard // Lizard eats paper // Paper disproves Spock // Spock vaporizes rock // Rock crushes scissors int Computerinput = (int)(Math.random()*5+1); String Play ="None"; switch(Computerinput){ case 1: Play = "Rock";break; case 2: Play = "Paper";break; case 3: Play = "Scissors";break; case 4: Play = "Lizard";break; case 5: Play =" Spock"; break; } System.out.println(Play); System.out.println("Rock = 1 , Paper = 2, Scissors = 3, Lizard=4, Spok=5"); if (Play.equals("Rock") && personplay.equals("Paper")) { System.out.println("paper cover Rock" + " person win"); computerPlay++; } else if (Play .equals("Rock") && personplay.equals("Scissors")) { System.out.println("Rock crushes Scissor " + "computer Win!"); computerPlay++; } if (Play.equals("Rock") && personplay.equals("Lizard")) { System.out.println("Rock crush Lizard " + "The computer win"); computerPlay++; } else if (Play.equals("Rock") && personplay.equals("Spock") ) { System.out.println("Spok vaporized Rock " + "person Win!"); computerPlay++; } if (Play.equals("Paper") && personplay.equals("Scissors" )) { System.out.println("Scissors cut Paper " + "you win"); computerPlay++; } else if (Play.equals("Paper") && personplay.equals("Lizard")) { System.out.println("Lizard eats Paper " + "You Win"); computerPlay++; } else if (Play.equals("Paper") && personplay.equals("Spock")) { System.out.println("Paper disaprove Spok " + "computer Win"); computerPlay++; } else if (Play.equals("Scissors") && personplay.equals("Lizard" )) { System.out.println("Scissors decapitate lizard " + "computer Win"); computerPlay++; } else if (Play.equals("Scissors") && personplay.equals("Spock" )) { System.out.println("Spock smashes scissors " + "You Win"); computerPlay++; } else if (Play.equals("Lizard") && personplay.equals("Spock" )) { System.out.println("Lizard poisons Spock " + "computer Win"); computerPlay++; } //• Determine the winner of the round and display how many games both the computer and player have won. //• Ask user whether they want to play again and keep playing until the user selects no. option=JOptionPane.showConfirmDialog(null, "Continue","Question",JOptionPane.YES_NO_OPTION); } //JOptionPane.showMessageDialog("computer win.",JoptinPane.How_Many_Times_Option); //• Display final results. // Print out computer play with joption, } }

  • loop query in javaAbdullah October 28, 2013 at 5:18 PM

    The following is my code:private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { BufferedReader br= null; try { br = new BufferedReader(new FileReader("//Users/abdullahalabbas1/Desktop/Artificial Intelligence/ASSIGNMENT PROGRAMMING/car copy 2.txt")); } catch (FileNotFoundException ex) { Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); } try { int n=0; int i=0; String line; char c=0; char [] arr1=new char[6]; while ((line = br.readLine()) != null ) { if(n<1250) { n++; System.out.print("0"+n+line+"\n"); for(;c != ',';i++){ c=line.charAt(i); arr1[i]=c; System.out.print(arr1[i]); jTextArea7.append(c+""); //arr2[i]=; } } } } catch (IOException ex) { Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); } } code result:1 vhigh,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 . . . 1250 my problem is: The compiler executes the second loop only at the first time, then it iterates for the first loop until the end without executing the second loop. What do I want? To execute the loops altogether for each iteration.

  • Java Program for parsing an XML Filesnaveen December 4, 2013 at 11:58 PM

    hi, Can anyone help me out in writing a java program for below XML Data XML DATA : ========== <?xml version="1.0" encoding="UTF-8" standalone="no"?> <tns:MOIList xmlns:tns="http://www.preconf.com/PRECONF" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.preconf.com/PRECONF OAM_PreConfig.xsd"> <MOI fdn="FGW=235,IuBC=1"> <Attributes> <Attribute DataType="INTEGER" Id="1014" Name="overloadCauseValue" Value="6"/> <Attribute DataType="INTEGER" Id="1003" Name="retryTimer" Value="5"/> </Attributes> </MOI> <MOI fdn="FGW=235,BladeHardware=1,PhysicalInterfaceB=22,PhysicalInterfaceBethernetPortid=1"> <Attributes> <Attribute DataType="Enumeration" Id="10000000" Name="ethernetPortidRowStatus" Value="1"/> </Attributes> </MOI> </tns:MOIList> REQUIRED FORMAT ============== <MOI fdn="FGW=235,IuBC=1"> <Attribute DataType="INTEGER" Id="1014" Name="overloadCauseValue" Value="6"/> <Attribute DataType="INTEGER" Id="1003" Name="retryTimer" Value="5"/> <MOI fdn="FGW=235,BladeHardware=1,PhysicalInterfaceB=22,PhysicalInterfaceBethernetPortid=1"> <Attribute DataType="Enumeration" Id="10000000" Name="ethernetPortidRowStatus" Value="1"/>

  • javaGopalakrishnan January 17, 2014 at 3:09 PM

    how to slove this error in java programming?? pls help me? The method setLayout(LayoutManager) in the type Container is not applicable for the arguments (int, int)

  • JavaRohan June 4, 2014 at 7:28 PM

    Java is basically used because it is platform independent as they say. The question is, using bytecode makes the compilation easy but you still have to build a JVM for specific machines to convert the bytecode to executable. The other approach would be designing a compiler directly for specific machines to convert java code to executable. So why bytecode? I mean still you have to build a JVM specific to a machine.So why not build a compiler directly?

  • javaZinnia March 30, 2014 at 3:53 PM

    do you want to play?then asking question how can v make it ??

  • java 3jsoftwaresolutions May 14, 2014 at 2:40 PM

    how can we pass a value from a column of first row to a column of second row my code is like this but it is not working for(int i=model.getRowCount();i<model.getRowCount();i++) { for(int j=0;j<model.getColumnCount();j++) { model.setValueAt(timings.getModel().getValueAt(i,j +1 ),i+1 , j); } }

  • advantages of cacaoVMsrikanth.pilli April 23, 2011 at 1:44 PM

    please tell me cacaoVM is suitable or not for touch screening on arm9 platform. and tell how to get cacaoVM cross compiler source code

  • advantages of cacaoVMsrikanth.pilli April 23, 2011 at 1:46 PM

    please tell me advantages of cacaoVM. and tell me how to get cacaoVM cross compiler source code

  • Matlab- input dialoguemary April 11, 2012 at 12:44 AM

    Matlab: I have a button on my interface that opens up a input dialogue box which the user enters 2 numbers which they want to playback the audio file. So if the user enters 10 and 20 then the audio file should play from 10 second mark to the 20 second mark. this is what i have coded however it is not working, any ideas why? I'm not sure where i have gone wrong?? function playsample_Callback(hObject, eventdata, handles) prompt = {'Enter playback starting point (secs):','Enter playback end point (secs):'}; dlg_title = 'Playback'; num_lines = 1; def = {'10','20'}; answer = inputdlg(prompt,dlg_title,num_lines,def); A = getfield(answer,{1}); % input field A = str2double(A); %converts string to double [y, Fs] = wavread('Argerich.wav'); sound(y(A*Fs, :))

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Core Java

Ask Programming Questions and Discuss your Problems
Ask Programming Questions and Discuss your Problems  ... section to submit your questions. For example, If you want to ask the questions... technological section Having Programming Problem? Ask Questions 

Programming Questions

Software Questions and Answers
online Discuss Software development questions, ask your questions and get answers... of answers to common programming problems. Ask Questions | Browse... - Ask your questions about securing your applications. Java 

General

Ask Programming Questions Online
Ask Programming Questions Online   ..., the integrated programming problems are also increasing. There are countless numbers... to share and sort out your problems. We have a strong network of software 

Programming Questions

Software Questions and Answers
programming problems. Ask Questions | Browse Latest Questions.... Discuss XML questions here. Security - Ask your questions... development questions, ask your questions and get answers online. Here you can 

IDE Questions

programming - IDE Questions
than 40 Fail Your program should display the Marks and Status for 5 subjects 

WebSevices Questions

programming questions
programming questions  this is my assignment questions please help me... the programs in c# language Describe the following with respect to creating Web Forms in .Net environment: a. Web Form Life Cycle b. Creating a Web Form 

Development process Questions

java programming - Development process
, We are providing you some code according to your examples. Please try them in solving your problems. // Answer 7 public class Answer7 { public...); } } Thanks for posting questions. RoseIndia Team 

General

Ask JEE Questions Online
Ask JEE Questions Online   ... or uses of J2EE. You can ask any J2EE questions online and get the most accurate... EE traditionally known as J2EE is a widely used platform for server programming 

Programming Tutorials

An Overview of Java      Java is a programming language      Java is Object Oriented Programming
; Java as a programming language Java is an Object oriented application programming language developed by Sun Microsystems. Java is a very powerful general-purpose programming language.   

Java Tips and Examples

Controlling your program
real-world problems.  The for Statement In the world of Java programming... Controlling your program      ... statements (break, continue, return) in Java programming language. Selection 

Java Beginners

Java Programming Help
Java Programming Help  Hello ! I m the student of last year and i need your help to complete my java project. I going to make a site like youtube. But i have a some problems to make it Q1: How to add videos dynamically in table 

General

Ask EJB Questions online
Ask EJB Questions online   .... But since now, you do not need to worry as for solving all your EJB questions; we... of enterprise applications. View and ask questions at http 

General

Ask Perl Questions Online
development. Ask any questions whether programming, scripting... Questions on Perl’. Just post your problems or queries and wait for our... Ask Perl Questions Online    

Programming Tutorials

Writing Articles for Showcasing Your Knowledge or Changing Lives?
, desires and problems of your readers. You should find out what kinds of questions are raging up in their lives so that you can offer your expertise in answering them. For this you will be required to ask questions to your readers so 

Interview Questions

Interview Questions and Answers
to see how you react to tricky questions. They are also assessing your... opportunity to discuss salary. In case you are pressed to disclose your current... side of five figures. Some employers might ask to see your salary slip or some 

JSP Servlet Questions

Programming error - JSP-Servlet
Programming error  Actually there is an error in placeorder.jsp file...?? And please reply me the answers of questions i asked you before and i have send you...: Sub Category: Title: Draft Your Ad Here 

IDE Questions

programming - IDE Questions
 

Java Interview Questions

PROGRAMMING - Java Interview Questions
 

Java Interview Questions

programming - Java Interview Questions
 

Java Beginners

programming error - Java Beginners
for your reply. and please do reply the latter questions that i have send you...programming error  import java.io.*; import javax.servlet.*; import...("Draft your Ad Here:"); out.println(""); out.println(""); out.println("Count 

General

Ask C/C++ Questions online
Ask C/C++ Questions online   .... Just ask to us and implement our solutions in your program. Feel free to ask any... your queries. For asking your question, use our service ‘Ask 

Java Beginners

arraylist problems?
arraylist problems?   myprogram needs to ask the user for a file name. The file will contain a name on each line. Put each of the names into an ArrayList. After you have put all of the names into the ArrayList search through 

Java Beginners

IT115 programming with java - Java Beginners
IT115 programming with java  3. Answer those questions that you can answer quickly first, then proceed with the other questions. 4. Ensure that you answer all parts of a question. Some questions have more than one part 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public 

Programming Questions

Ask Questions
. So, join us and enjoy our new service You can ask your questions...;  Junit Questions   Programming Questions PHP Ask... Ask Questions       

Java Interview Questions

i need your help - Java Interview Questions
i need your help  Write a java program that: i. Allows user to enter 2 numbers from the keyboard ii. Uses a method to compare the two numbers to determine which is larger iii. Print to the screen stating which number is larger 

Interview Questions

What would you rate as your greatest weaknesses?
What would you rate as your greatest weaknesses... for your honesty, but your resume will end up in the dustbin after the interview... not really see any drawback in your background that might affect the job at hand 

General

Collection of Large Number of Java Interview Questions!
of Interview questions, you can discuss interview topics questions and answers here... in your job interviews. Just email me your questions and answers... these interview questions to improve your core Java knowledge.  

DMCA.com