36,051 Topics

Member Avatar for
Member Avatar for viteb

Javascript is a object oriented programming language.It is a flexible language.This loosely programming language has its own built-in datatypes.It offers three primary data types,two special data types and two composite data types. -> The primary data types are :- (1) Boolean (2) Number (3) String -> The special data types …

Member Avatar for jalpesh_007
0
53
Member Avatar for Pyler

/*Ok I have code that's behaving unexpectedly The following program is supposed to print prime numbers for n1=100,n2=1000,n3=10000 and n4=100000 except that for n1=100, it prints the squares of primes less than 10. I can implement this same program in c++ and wouldn't get such output. I need another pair …

Member Avatar for VernonDozier
0
238
Member Avatar for dantheman4

1.Suppose a method is declared as: public static void f (double d, int n) { ....; } Which one of the follow method invocations would compile with no errors? Select one: a. f(2.5, 3.5); b. f(2, 3); c. f(2.5); d. f(3); I chose b 2.Each of the following pieces of …

Member Avatar for VernonDozier
0
186
Member Avatar for cafegeo

Hello everyone. I am starting a class that utilizes Java for software design. I have no previous java experience, although I have taken c++ prior to this and appreciate all the help I have received in the past. I also would like to thank everyone in advance for all your …

Member Avatar for NormR1
0
215
Member Avatar for sharathg.satya

any one help me in completing my program on FLAMES game i am not getting how to complete it please help me

Member Avatar for NormR1
0
2K
Member Avatar for javalover

Hi friends, I want to create an auto-evaluator for java.. If I submit java program, it has to run and show the output or exceptions(if so).. I tried in some simple ways, it doesnt works out. please give some suggestions how to start and progress... Thanks in advance...

Member Avatar for NormR1
0
773
Member Avatar for Dark007

I wrote a server class and a client class. again i wrote 4 different JFrame class which were connected with each other and some Puzzle game codes were written on this classes. I want to add those classes with the server. and want to play those games from the client. …

Member Avatar for Dark007
0
190
Member Avatar for Goldfinch

I have this code: static String format(String number, int decimalLength) { char[] decimal; System.out.println(number); String[] formatA = number.split("."); System.out.println(formatA.length); StringBuilder cents = new StringBuilder(""); int dollars = 0; dollars = Integer.parseInt(formatA[0]); decimal = formatA[1].toCharArray(); for (int i = 0; i < decimal.length; i++) { if (i < decimalLength) { cents.append(decimal[i]); …

Member Avatar for stultuske
0
183
Member Avatar for I_m_rude

The publicity team for Technozion is in full swing. Like every year, this time too, the team is planning to visit N different colleges in India. This publicity campaign shall involve the members of the team giving presentations about Technozion. For the publicity trip, the team has decided to come …

Member Avatar for I_m_rude
0
280
Member Avatar for calomari

I just completed one JAVA course. I used NetBeans. I ran into a friend recently who told me about Eclipse. In my next class I had to write a program with a GUI application. Which IDE do you prefer? Why?

Member Avatar for stultuske
0
94
Member Avatar for Matth963

Hi, I'm doing a study planner in java. I'm doing a simple login system. For every user who registers a text file is created holding all of the information inputted during registration. This is the code of a method which the program uses to login the user: public void loginUser(){ …

Member Avatar for Matth963
0
298
Member Avatar for rahul.ch

Why does first two eg give true when a check done on them using if(x==y) but 3rd and 4th case give false? eg1: `String x = "Hello", y="Hello" ` eg2: `String x = "Hello";` `String y= "Hello";` eg3: `String x="Hello";` `String y = new String("Hello");` eg4: `String x = new …

Member Avatar for rahul.ch
0
246
Member Avatar for FaisalSarfraz

Hi every one!! I need help to match user data from database inorder to log in to admin panel. Here is what I am trying. it works ok but it is giving dialog box containing text "Sorry! You have no access to Database" here is the code. Please help String …

Member Avatar for FaisalSarfraz
0
293
Member Avatar for plasticfood

i have a private Node class with a getValue() method that returns the Node's value which is of generic type. In another class i've tried doing this: T tempItem = null; ----also generic tempItem = currentNode.getValue(); I get a complier error unless I cast it like this: tempItem = (T) …

Member Avatar for plasticfood
0
234
Member Avatar for silverkid

why do i get this syntax error at the line shown below [CODE]package org.temp2.cod1; import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.io.*; public class Code1 { byte[] plaintext = new byte[32]; // <<<<<<<<<<<<<<<<<<<<<<<<<< syntax error for (int i = 0; i < 32; i++) { plaintext[i] = (byte) (i % …

Member Avatar for LaughingOtter
0
22K
Member Avatar for roshan janyani
Member Avatar for krovi

what is wrapper calss .where can we use wrapper class in java.give me one example?

Member Avatar for JamesCherrill
0
114
Member Avatar for rahul.ch

The o/p is 10. But shouldn't it be 9? Is it got anything to do with Postfix or variable scoping has a role to play?

Member Avatar for rahul.ch
0
173
Member Avatar for borchu

Hello everyone, I am new at Java(android)-before I have little information about Java lang- and in particular socket programming -before I do not know nothing about socket client server programming-, previously I wanted to write simple chat program by using Threads and now I pass this step, two android emulators …

Member Avatar for borchu
0
984
Member Avatar for George2

Hello everyone, When using the following source codes to play a local .wav file, I always find .wav files can not played. Does anyone know what is the trouble? [Code] import java.io.File; import java.io.IOException; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; public class …

Member Avatar for stultuske
0
984
Member Avatar for rahul.ch

Compiles fine. But at runtime it gives ClassCastException. My doubt is that why is it so even though st which is of type Sample1 gets casted to Sample2 and generates exception even though Sample2 IS-A Sample1.

Member Avatar for rahul.ch
0
246
Member Avatar for chuckc

I have an odd problem with a Java-based Internet program that I would like to use on a regular basis on my Windows XP computer. I have not done Java programming, so I would be interested to know if anyone has ideas about what might be happening. The program runs …

Member Avatar for chuckc
0
243
Member Avatar for vanushka.m

Iam working on a attendance management project to get inputs from fingerprint scanner and save it into mysql database such as date and time and also to vertify the staff members. If anyone could assist it would be a great help.

0
45
Member Avatar for greg2186

I'm a beginning programmer and am stumped on the last part of this assignment. I can't seem to figure out how to have the Letter Grade show. Here's what I have so far, any help as to where I'm going wrong would be much appreciated!! import java.util.Scanner; public class Lab1 …

Member Avatar for greg2186
0
1K
Member Avatar for dantheman4

public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the begin string, followed by n copies of the middle string, followed by the end string. …

Member Avatar for NormR1
0
191
Member Avatar for krovi
Member Avatar for dantheman4

package cs1410; import javax.swing.*; public class P2 { public static void main(String []args) { drawDiamond(); } public static void drawDiamond() { int x,y,z; int a=1; String out="\n"; int i=Integer.parseInt(JOptionPane.showInputDialog("Enter your size")); if((i%2)!=0) { int in=(i/2)+(i%2); int bb=in-1; int b=bb+(bb-1); for(x=in;x>0;x--) { for(y=x;y>1;y--) out+=" "; for(z=0;z<a;z++) out+="*"; a+=2; out+="\n"; } for(x=0;x<in-1;x++) …

Member Avatar for JamesCherrill
0
240
Member Avatar for calculuskatie

Write a program that does the following: a) creates an array of user specified length of random integers between 0 and 100. b) allow user to print array in ascending or descending order. c) allow user to search for specific int value (you can use your code from part 2) …

Member Avatar for stultuske
0
180
Member Avatar for Seswing142

1. Write a program to compute the annual rate of return on an investment. The program will ask the user for the original purchase price, the number of days the investment was owned, and the final sale price. The program must then print out the difference between sale price and …

Member Avatar for Seswing142
0
352
Member Avatar for im abcd

My program on compound interest gets compiled fine but it won't display anything . Yesterday When I created a new class and tried to run a simple for loop , the same thing happened . But when I tried to run the same for loop in a previously made class …

Member Avatar for im abcd
0
255
Member Avatar for nHulk

This is error its throwing : javax.servlet.ServletException: /dtl.xhtml @13,75 value="#{registerBean.reteriveData()}" Error Parsing: #{registerBean.reteriveData()} javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) dtl.xhtml <h:dataTable value="#{registerBean.reteriveData()}" var="rb"> <h:column> <f:facet name="header"> <h:outputText value="Model" /> </f:facet> <h:outputText value="#{rb.fname}" /> </h:column> </h:dataTable> registerBean.java public List reteriveData() { Connection con = null; List list = null; try { DBConnection db = new …

Member Avatar for nHulk
0
239
Member Avatar for MistaGeorge

I have a 2D array and i am trying to look for Similarities in the data, via number patterns. For Example: 1) 3,4,5,6,7 2) 1,4,8,23,56 3) 14,15,16,34,45 Now what i would like to do is search this array to find patterns like in example 1. it goes 3,4,5,6,7 or in …

Member Avatar for delta_frost
0
1K
Member Avatar for fularipk
Member Avatar for rotten69
0
2K
Member Avatar for borchu

Hello everyone, I have problem with my simple android chat program when using different test debugging. I have two android emulators one reads SERVERPORT as 8080 and CLIENTPORT as 8082 and the other android emulator reads SERVERPORT as 8082 and CLIENTPORT as 8080 from a given txt file. Here there …

Member Avatar for borchu
0
2K
Member Avatar for borchu

Hello again, I have been posting consecutively in these days nearly same topics, actually I am intern at a sofware company and our company ask to perform the proof of conception about sending voice call -at the beginning- and finally video calls, like walkie talkie application; as you have already …

Member Avatar for borchu
0
248
Member Avatar for sanilo

Hi ! I have a JFrame which contains some textfields and buttons. imagine a situation that a user wants to fill sth in textfield, then she/he needs more textfields to be shown ! I want when the user clicks a button, more textfields will appear ! its like cc/bcc in …

Member Avatar for JamesCherrill
0
196
Member Avatar for ganges
Member Avatar for stultuske
-1
73
Member Avatar for Johannady2

When you enter "y" and try again. it doesn't asks you to "enter a String: " and "enter another String: " again. It just prints those lines out but you don't get to enter. Well~ you can enter 1 string again when it does the loop but I don't know …

Member Avatar for Susith Anuranga
0
355
Member Avatar for Lindsey1211

Hi, I just started working with Java for a class and Im a little confused. My code is supposed to convert seconds to hours, minutes and the remainder of seconds. for whatever reason my answer is 8 seconds off of what it should be. The example I was given is …

Member Avatar for Lindsey1211
0
126
Member Avatar for SSagar

Hi, I am struck in accessing c functions from java. I have .lib file and 5 dll files which are interdependent. I need to access the c functions in java. Please help me. i have no idea on this. Thank You, Sagar

Member Avatar for JamesCherrill
0
217
Member Avatar for lj81

Hey just a question to prove me right or wrong. I am wondering what the 'this' in the following code refers to in terms of my applet. mainThread = new Thread(this); I believe that it refers to the run method which defines the thread. I was told I was wrong …

Member Avatar for JamesCherrill
0
118
Member Avatar for gimmeuheart

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package buttontest; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * * @author noorulrafiedza */ public class ButtonTest extends JFrame { private JButton Button , Button1,b; private JPanel Group; private JCheckBox cek1; …

Member Avatar for harinath_2007
0
1K
Member Avatar for ITHope

I have to create a java program using either a regualr array or arraylist so I chose arralist and I named it horses but now have to create another method with in the programming inorder for a user to input/search for "trigger" and if it is found it shows the …

Member Avatar for javaAddict
0
321
Member Avatar for vinnitro

This is my program for Biodata in applet using JFrame import javax.swing.*; import java.awt.*; public class Biodata extends JFrame { JLabel jlname,jladd,jlmobno,jldob,jlgender,jltab,jlhob,jllang; JTextField jtname,jtmobno; JTextArea jtadd; JComboBox jcd,jcm,jcy; JRadioButton jrm,jrf; ButtonGroup bg; JTable jtedu; JScrollPane jsp,jshob; JList jlhobby; JCheckBox jc1,jc2,jc3; JButton jb1,jb2; JPanel jpr,jpcombo,jpcheck; JFrame jf; Biodata() { jf=new JFrame("Biodata"); …

Member Avatar for vinnitro
0
1K
Member Avatar for dantheman4

I am supposed to use this method public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) This is what I am suppsed to do **It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the …

Member Avatar for dantheman4
0
355
Member Avatar for bigzos

public class Student{ private String name; public Student(String name) {this.name=name; } public void setName(String sett){ name=sett;} public String getName() {return(name);} } public class Swaptest{ public static void swap(Student p,Student q){ Student temp; temp=p; p=q; q=temp; } public static void main(String a[]) {Student s1=new Student("John"); Student s2=new Student("Mary"); swap(s1,s2); System.out.println("s1="+s1.getName()); System.out.println("s2="+s2.getName()); …

Member Avatar for deceptikon
0
81
Member Avatar for zeusprog
Member Avatar for zeusprog
0
3K
Member Avatar for johncatman

I would like my vb2010 program to click on a javascript element on this webpage depending upon what they choose, here is the source of the rating system, thanks in advance: <div class="basic-info-rating basic-info-user-rating" style="display:none"> <div class="rating quick-rating"> <p class="average rating-3">3 stars</p> <ol class="user" data-analytics='{"click_id":1865,"events":"event6,event7,event24"}' data-ypid="5550608"> <li class="rating-1"> <a data-analytics='{"rating":1}' …

Member Avatar for G_Waddell
0
252
Member Avatar for Deepika Deepi

hi all, Good noon. I am trying to get the match a key word from text, get the input from text and if the match in the text matches with the input. I need to get the result of that. If the word starts in the middle i should not …

0
64
Member Avatar for lse123

trying develop a Russian/English Flag game, given the flag image you choose in Russian or in English modes... Since English country names get from country file image names, can have a Java generic Map key=englishCountryName & value=inRussianEquivalent.... to do the Russian part??? Or exist other way? if you think this …

Member Avatar for lse123
0
191

The End.