35,618 Topics

Member Avatar for
Member Avatar for Forte1292

Okay so we are doing a BankAccount program in my CS class. One method is supposed to return the information like this - Account Name: <name here> Account Number: <number here> Account Balance: <balance here> The instructions say to return it on multiple lines using the \n command. How do …

Member Avatar for Forte1292
0
127
Member Avatar for mohamed moamen

[CODE] float i = 55 ; float y = 23 ; float u = i / y ; System.out.println(u); [/CODE] i want to print u Round to five decimal places how i can do this approximation ?

Member Avatar for mohamed moamen
0
121
Member Avatar for techyworld

Can someone dry run and explain me this code? having problem to understand recursion program. [CODE] public class Multiplication { public static void main(String[] args) { System.out.println("Answer:"+Mult(2,3)); } public static int Mult(int x,int y) { if (y==1) return x; else return x + Mult(x,y-1); } }[/CODE]

Member Avatar for techyworld
0
88
Member Avatar for drogba123

Hi, I know matrix 2d can be written like array[5][5] which saying 5x5 matrix but how do i make the row is like sequence of alphabets so its like array[a...z][5] while the column still numbers. Thanks.

Member Avatar for drogba123
0
120
Member Avatar for jeffreymummey

I need to build a gui application for Nim. I started writing the code and need help. Will you help me write the Nim game? import javax.swing.JOptionPane; public class Nim { public static void main( String args[] ) { String firstNumber; String secondNumber; int number1; int number2; int sum; firstNumber …

Member Avatar for pluspluss
0
108
Member Avatar for ~s.o.s~

[URL="http://www.youtube.com/watch?v=b-Cr0EWwaTk&feature=player_embedded#!"]An Oracle produced song to promote Java; fun stuff[/URL]. ;-) Lyrics at: [url]http://www.adam-bien.com/roller/abien/entry/code_hard_with_java[/url]

Member Avatar for Netcode
0
131
Member Avatar for b.netana

[CODE]import java.util.Arrays; import java.util.Comparator; public class CameraInventory2 { // The main entry public static void main(String[] args) { // create the array Camera[] camera = new Camera[3]; Cam cam = new Cam(); camera[0] = new Camera(1, "Nokia", 20, 30.0, 8); camera[1] = new Camera(2, "Polaroid", 10, 21.0, 14.1); camera[2] = …

Member Avatar for hfx642
0
288
Member Avatar for teo236

hello i'm trying to draw a kind of arrow with an specific thickness. i've already this: [CODE] public void paintComponent(Graphics g){ super.paintIcon(comp, g, width, height); for(int i=0;i<thickness;i++){ Polygon arrow=new Polygon(); arrow.addPoint(7*scale, 0*scale+i); arrow.addPoint(14*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 29*scale-i); arrow.addPoint(4*scale+i, 29*scale-i); arrow.addPoint(4*scale+i, 9*scale-i); arrow.addPoint(0*scale+i, 9*scale-i); g.drawPolygon(arrow); } g.setColor(Color.BLUE); Polygon arrow=new Polygon(); …

Member Avatar for hfx642
0
127
Member Avatar for esy928

Hello! Im a java noob and I need to create a program that determines whether the input is an integer or not , can anyone help me out? thanks in advance! btw I have to use [B]Scanner [/B] from [B]java.util.[/B] , I have no idea on how to check if …

Member Avatar for abors
0
639
Member Avatar for zach&kody

After compiling this code, I am getting a "cannot find symbol constructor Timer(int,Morning)" on line 17. [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Morning extends JFrame { private EasySound rooster; private int time; /** * Constructor */ public Morning (int time) { time = 0; Timer clock = new …

Member Avatar for stevenwilson
0
406
Member Avatar for bhagawatshinde

Hi, i am trouble to connect with sqlserver 2005 in windows authentication mode which do not contains username and password it will give me an error like connection failed for user ''(blank) here is my connection string [CODE]string URL="jdbc:sqlserver:\\localhost:1433;dbname"[/CODE] can anybody help me please

Member Avatar for ~s.o.s~
0
87
Member Avatar for dgar

Hi , My name is Dennis a DBIT student.I am kindly asking for assistance in any of the following questions .It's part of my research so i kindly request if you would explain to give me a better understanding and also equip me with the knowledge of handling questions of …

Member Avatar for peter_budo
0
119
Member Avatar for gotm

hey guys. OK so, I've been wondering this for a while now. my code is always so unnecessarily cluttered because I don't know how to do this, lol. say I have a set of private class variables: [code=java] private ArrayList row0 = new ArrayList<String>(); private ArrayList row1 = new ArrayList<String>(); …

Member Avatar for JamesCherrill
0
167
Member Avatar for cwarn23

Hi, I'm developing a new Java applet and it requires a 3d engine to import a 3d model with a texture wrapped around the model. Then the user will be able to browser around the model in like a first person shooter style but just browse/look around, nothing else. Does …

Member Avatar for cwarn23
0
158
Member Avatar for WolfShield

C++ was once the King of programming. It would crush any competitor! But, now it seems that C++ is getting less popular. New programmers are rushing to easier to learn, higher level, programming languages (e.g. Java). And with Microsoft coming out with C# which is gaining popularity (even though it …

Member Avatar for Netcode
0
1K
Member Avatar for eddieteddie

Hi all Can someone tell me the difference between public static void main and private static void main? What is public and what is private and static? Thanks guys+girls

Member Avatar for bhagawatshinde
0
87
Member Avatar for ravsau

Hi everyone. I am new to java programming and taking a class in college. I got to a problem which I can do but i don't know the correct way to do it. It says to use mutator and accesor . can you please explain what should i change? I …

Member Avatar for dononelson
0
878
Member Avatar for cmsc

I'm trying to use bufferedImage to display the bac[ICODE][/ICODE]kground of my application but i'm not successful. I don't get what's wrong with it here's the part of the code: [ICODE] Graphics g; BufferedImage offscreen; offscreen= ImageIO.read(new File("mainScreen.png")); g.drawImage(offscreen, 0, 0, null); [/ICODE] and i use the paintcomponent() here : [ICODE] …

0
67
Member Avatar for rezial

hey i got this 3d cube that rotates and does other cool nonsense HOWEVER i cant figure out how to color it. Need to do it with out using java 3d and i DO know about the painters algorithm, i just dont know exactly how to go about implementing it …

Member Avatar for hfx642
0
357
Member Avatar for sjava

public class Employee { private String Name; private String SIN; private Integer Salary; public Employee(String string, String string2, int i) { // TODO Auto-generated constructor stub } public Employee() { } public Employee(String N, String sin, Integer Sal) { Name = N; SIN = sin; Salary = Sal; } public …

Member Avatar for sjava
0
113
Member Avatar for blackrobe

Hey all, I've been struggling for the past few days with a "recursive" function that was driving me crazy till this moment. So, the function takes a list of sublists, each sublist containing a number of strings. Then, the function returns a list of lists of all possible combinations that …

Member Avatar for Mavericks
0
9K
Member Avatar for cozmo87

The following code works: [CODE] public class Main { public static void main (String args[]){ final JWindow f = new JWindow(); JLabel l = new JLabel(new ImageIcon(Main.class.getResource("images/logo.png"))); f.getContentPane().add(l, BorderLayout.CENTER); f.pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension labelSize = l.getPreferredSize(); f.setLocation(screenSize.width/2 - (labelSize.width/2), screenSize.height/2 - (labelSize.height/2)); f.setVisible(true); f.setAlwaysOnTop(true); } }[/CODE] When I …

Member Avatar for cozmo87
0
620
Member Avatar for christot

please help me , i really dont have any idea about our project . i need to fix it 1 week before our defense so that i can work well with it and study all about it ..

Member Avatar for christot
-1
220
Member Avatar for Delocaz

I'm looking for how to brute-force the result of something like [ICODE]"Hi".hashCode()[/ICODE]. I have no idea where to start. I looked for the answer for like 5 hours yesterday. It's for reversing Minecraft seeds. (seed-to-text). I tried my own solution. It's too crap to even post. I tried to find …

Member Avatar for Delocaz
0
1K
Member Avatar for i2u2me

In Java Create a file using any word processing program or text editor. Write an application that displays the file's name, containing folder size and time of last modification. Save as FileStatistics This is what I have with Attributes errors, what am I missing here ? Thanks <CODE> import java.nio.file.*; …

Member Avatar for stultuske
0
180
Member Avatar for twinkle2011

[CODE]import java.io.*; class FinalProject{ public static void main(String[]args){ String name=" ", month, date; int total,cash=0,bal=0,y=0; int r=0; boolean ans=true; int test; do{ try{ FileWriter extend = new FileWriter("extension.txt",true); BufferedWriter out = new BufferedWriter(extend); System.out.print("Welcome! to GLORIA'S FUDHAUZ \n"); System.out.print("Enter date: "); date = Enter.readString(); System.out.print("Enter name: "); name = Enter.readString(); …

Member Avatar for stultuske
0
85
Member Avatar for SagarSe7en

Hello Everyone! Very close to completing my project but a small favor needed! Which is blocking me from finishing the last section of the project! This is how it goes!!!!! Have an Interface with inc complete methods [CODE] //OshwalDAO.java void InsertLog(String LogID , String Username , java.Util.Date CurrentDate) throws ClassNotFoundException …

Member Avatar for SagarSe7en
0
897
Member Avatar for Santosh gupta

[CODE] [1]class A{ [2]public static void main(String...agrs){ [3]String str1="ABC"; [4]String str2="ABC"; [5]String str3=new String("ABC"); [6]} [7]} [/CODE] How many objects are created at each line and finally at line 7?

Member Avatar for Santosh gupta
0
102
Member Avatar for laguardian

Hey guys! I'm working on a console calculator. My problem is that how would I perform the inputted operator? So, if the user inputs "+" and a "-" it will perform those. Here's what I have so far: [code] import java.util.Scanner; public class Calculator { public static void main (String …

Member Avatar for harinath_2007
0
139
Member Avatar for Mugetsu Tensho

Hi, its has been a long time since I have used java and I would like some help making this loop as long as you say yes when you say no the loop will stop but not the program [CODE] if (place.equals("swordsmith")) { System.out.println("Hello " + name +"! Would you …

Member Avatar for Mugetsu Tensho
0
273

The End.