32,199 Topics

Member Avatar for
Member Avatar for DahliaBasik

/** * @(#)GeometricObject.java * * GeometricObject application * * @author * @version 1.00 2012/9/10 */ public abstract class GeometricObject { private String color = "white"; public GeometricObject(){ } public GeometricObject(String color){ } public String getColor(){ return color; } public void setColor(String color){ this.color=color; } public String toString(){ return " the …

Member Avatar for DahliaBasik
0
2K
Member Avatar for strizh

I need to override String toString method so it woud print my deposits I dont't know how to override it, since in makeDeposit method I pass two variables I'm posting just a saple of my code, I'm not sure if you need the whole code public class Bank { private …

Member Avatar for stultuske
0
161
Member Avatar for anglwthnati2de

Hi guys. I am having issues with the output of this program. Can somebody tell me what I have to do to make this work correctly? Here is the code I have so far: import java.util.Scanner; //text scanner to parse primitive types and strings using regular expressions. public class Operations …

Member Avatar for anglwthnati2de
-2
275
Member Avatar for aabbccbryanmark

public class asterisk { public static void main(String[] args) { int row, col, spc=3, spc1=2, spc2=1, spc3=0; for(row=1;row<=1;row++) { for(col=1;col<=1;col++) { for(spc=spc;spc>0;spc--) { System.out.print(" "); } System.out.print("*"); System.out.println(); { for(spc1=spc1;spc1>0;spc1--) { System.out.print(" "); } System.out.print("**"); System.out.println(); { for(spc2=spc2;spc2>0;spc2--) { System.out.print(" "); } System.out.print("***"); System.out.println(); { for(spc3=spc3;spc3>00;spc3--) { System.out.print(" "); } …

Member Avatar for stultuske
0
586
Member Avatar for gurusubramaniam

Hi.. I want redirect a frame into next frame. In swing method how to redirect a frame into next frame ?

Member Avatar for stultuske
0
135
Member Avatar for poojavb

Hello All, I have a Java program which is using a JOptionPane in it. eg. Are you sure u want to close the application? Yes No When I click with the mouse on the No button it works correctly but if I select the No button using the TAB key …

Member Avatar for poojavb
0
408
Member Avatar for Matth963

I want to do this: When I press on a checkbox 'Monday', the program displays the List 'lstMonday' When I press on a checkbox 'Tuesday', the program displays the List'lstTuesday' How can I achieve this? I've tried to do it ut can't:( Thanks in advance

Member Avatar for stultuske
0
112
Member Avatar for borchu

Hello everyone, I have question about how AudioTrack instance should be used for streaming applications. Below my code example and some brief explation about code ... /* some work before */ InputStream in = client.getInputStream(); AudioTrack output_stream = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT, 8192, AudioTrack.MODE_STREAM); byte[] buffer = new byte[8192]; …

Member Avatar for borchu
0
523
Member Avatar for jury

hy!!!!i am trying to write a java code that returns the majority element in an array and -1 if not!!this is what i came with public class Majority{ public static int arrMajority1(int A[]){ int n = A.length; int c = 1; for(int i=0;i>A.length;i++){ for(int j=i+1;j<A.length;j++) if (A[i]==A[j]) c=c+1; if (c>(A.length/2)){ …

Member Avatar for Nutster
0
139
Member Avatar for adishardis

I'm trying to use limesurvey but cannot get the slider as i would like it. Here is a link to the surveyquestion: http://adam.synology.me/limesurvey/index.php/survey/index/sid/164171/newtest/Y/lang/sv I want the images to change according to the value of the sliders. With a regular html form i had this to take care of it: <script …

Member Avatar for adishardis
0
201
Member Avatar for mobility42

Hello All, this is my first post, so bear with me... My problem is with the following code. I have a simple menu setup to do some number conversions, and everything compiles properly. When i run the code, i end up with the Java VM (in bluej) just running endlessly, …

Member Avatar for NormR1
0
1K
Member Avatar for classicshot

how can we create accounting vouchers use in departmental store for selling products through jswing in java programming..??

Member Avatar for NormR1
0
66
Member Avatar for london-G

Hello, I am currently working on a project and I am stuck at the moment. Basically I have a few JToggles buttons, a jbutton and a text box. When the user select a jToggle button, write some text in the text box and clicks on the Jbutton, the text on …

Member Avatar for london-G
0
124
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
51
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
232
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
183
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
212
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
767
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
187
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
182
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
90
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
296
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
241
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
292
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
231
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
108
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
170

The End.