32,204 Topics

Member Avatar for
Member Avatar for gahhon

[CODE] public class Planet { private String planetName; private int travelDay; public Planet(){ planetName = "Earth"; travelDay = 365; } public Planet(String planetName, int travelDay){ this.planetName = planetName; this.travelDay = travelDay; } public void setPlanetName(String planetName){ this.planetName = planetName; } public String getPlanetName(){ return planetName; } public void setTravelDay(int travelDay){ …

Member Avatar for gahhon
0
128
Member Avatar for I<LateNupurGuha

[INDENT];)Suppose a method is called with [COLOR="Red"][B][I]formal[/I][/B][/COLOR] parameters of [COLOR="Red"]supertype[/COLOR] and [COLOR="Red"][B](1)[/B][/COLOR]the [COLOR="Red"][B][I]actual[/I][/B][/COLOR] parameters of [COLOR="Red"]subtype[/COLOR]; Now the method declaration is [COLOR="Red"][B](2)[/B][/COLOR]overridden and overloaded in the [COLOR="Red"][B](3)[/B][/COLOR]previous same [COLOR="Green"]class[/COLOR] as well as in the [COLOR="Red"][B](4)[/B][/COLOR]overriding [COLOR="Green"]subclass[/COLOR]. :icon_rolleyes:An [COLOR="Green"][B]object[/B] [I]reference[/I][/COLOR] is used on which the call is performed; Here the [I][COLOR="Green"]reference[/COLOR][/I] …

Member Avatar for peter_budo
-1
60
Member Avatar for i2u2me

Why do you think the Java language chooses to treat file data as a stream rather than as a single object?

Member Avatar for i2u2me
0
73
Member Avatar for luky279

HI, Iam trying to develop SMS Application by using java communicaition API. iam getting error msg like com.sms.samples.SerialConnectionException: Port currently owned by SMSConnector Iam aware that by using modem we can develop an application. But how to develop with out using modem.what are the requirements required. plz help me ..... …

0
56
Member Avatar for xaelophorus

Hello all! I'm helping my employer redesign their database system. They're currently using MS Access exclusively, but they are updating their computer systems to Apple machines and want to convert to a standalone application to access a background database (e.g., a standalone Java program using JDBC to access a background …

Member Avatar for ~s.o.s~
0
188
Member Avatar for hhheng

I'm new to Java and while trying to add a text area to the applet, found the textarea uneditable, and while trying to add the scrollbar to the textarea, found the applet will not be started. Code as below: [code=java] import java.awt.*; import javax.swing.*; import java.applet.Applet; public class AppletEditor extends …

Member Avatar for hiddepolen
0
410
Member Avatar for kiranShankar

sir -- i wrote in the jsp for remving junk character from the application [code]<% request.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=UTF-8"); %>[/code] but still some page show the junk character what should i doo...

0
63
Member Avatar for yuca89

Hello! I am writing a simple java application which executes another command with "sudo" (on Ubuntu). My application works properly when i start it with "sudo my_java_application". But if i start it without sudo it does not works. And it does not ask me for password. It gives error when …

Member Avatar for yuca89
0
80
Member Avatar for atramposch

Imagine a windows paint program that draws a square. I wrote some code to do the following: A vertex change may make a square bigger or smaller (or unchanged if the vertex value is the same). You must adjust the other vertices, as necessary, to keep the shape a square. …

0
62
Member Avatar for Procx

Hello, I'm currently working on a small database project with various search algorithms. Right now I seem to be a little stumped. Basically what I need to is to read a huge file of strings, such as these 2 lines: Abram,Smith,70,M,Nursing Unit,324b Ace,Lewis,7,M,Intensive Care Unit,324c I then need to delimit …

Member Avatar for Procx
0
89
Member Avatar for rayden150

Good evening im seeking help with this program, it is in a loop that ends if a negative number is entered, I am trying to get the largest number entered in the do while loop, ive tried creating a temporal variable (temp), but I dont know where to go from …

Member Avatar for Taywin
0
207
Member Avatar for Hikari123

Hi, I am a beginner so bear with me. I have an assignment in which I have to create an array with numbers and then have a loop with condition to check in which order the user has inputed the numbers. Asc=1, desc=-1, other=0. This loop isn't working, i know …

Member Avatar for Hikari123
0
123
Member Avatar for applejax77

write a java program that prompts the user to input and integer and then ouputs both the individual digits of the number and the sum of the digits. This is what I have but it is not working when I input a negative number. Why? Need help! import java.util.*; public …

Member Avatar for applejax77
0
148
Member Avatar for Laxman2809

Alright so I have to Save and Load an array, and I am unfortunately running into issues at saving, where it keeps giving me the error[QUOTE]Exception in thread "main" java.lang.NullPointerException at java.io.FileOutputStream.<init>(FileOutputStream.java:186) at java.io.FileOutputStream.<init>(FileOutputStream.java:84) at SocialEventList.saveAppointmentData(SocialEventList.java:41) at Test.main(Test.java:120)[/QUOTE] [CODE]import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; public class SocialEventList { private SocialEvent[] …

Member Avatar for hiddepolen
0
268
Member Avatar for vijaykavin10

What is the usage of JTabbedPane and JPanel and which case we are using the components... Thanks

Member Avatar for mKorbel
0
66
Member Avatar for cgen

I need some idea how to correct this program. Though I think I understand the concept, my implementation is wrong. My program only prints the orignal string and does nothing with it. [CODE] public class ArrayStack<E> implements Stack<E> { protected int capacity; protected static final int CAPACITY = 1000; protected …

Member Avatar for JamesCherrill
0
1K
Member Avatar for anand01

Hi all, I did some basic method overloading program, when I run the bellow program i got output as int long but expected is short long.. can Any one explain me My code is : [CODE]public class MyClass { public static void disp(Long n) { System.out.println("Long "); } public static …

Member Avatar for anand01
0
81
Member Avatar for DragoDraco

I am trying to get the program to print how many of each letter of the alphabet is in the bible but it is throwing and error. I am just using a small part of the bible until I get it to run properly. Please help. import java.io.File; import java.io.FileNotFoundException; …

Member Avatar for DragoDraco
0
158
Member Avatar for mattnguyen45

The last do..while loop only prints the 2^n of the number entered and n is user input. It does not print all 2^n from 1 to what ever value user inputted. [CODE]/** * * * @author * @version */ //import Scanner utility import java.util.Scanner; public class Loops { public static …

Member Avatar for JamesCherrill
1
172
Member Avatar for Jfunch

The problem I am trying to solve is Write a program using fork() to compute average of N numbers. The parent process forks a child process that takes input from the user, adds all the numbers and returns the sum and the count of numbers to the parent process that …

Member Avatar for JamesCherrill
0
2K
Member Avatar for yup790

I am trying to make a Fibonacci sequence program to display up to the nth term(only positive numbers). For some reason it doesn't seem to work. [CODE]import java.util.Scanner; /** * * @author Toby */ public class Fabonnacci { /** * @param args the command line arguments */ public static void …

Member Avatar for JamesCherrill
0
242
Member Avatar for Aviras

Dear Daniwebbers, I have a problem regarding the calling of methods on a protected parent object from within a child object, the protected parent object being a child object of the same class. I have a class HostileArea, wich has a "protected DungeonRoom[][] dungeon", DungeonRoom being a child of HostileArea. …

Member Avatar for JamesCherrill
0
219
Member Avatar for gedas

hey Guys, im creating a clas that is to be used in a HashMap to map phone numbers to name. for example : map.put( new PhoneNumber(207, 8269600, 260), “Paul”); [CODE] public final class PhoneNumber { private final int areaCode; private final int number; private final int extension; public PhoneNumber(int areaCode, …

Member Avatar for gedas
0
116
Member Avatar for buskerott

I know this is easy but I think some people out there are interested in my idea about storing user input in an array...... i read it some where and thought about bringing it much closer to you. [code]import java.util.Scanner; /** * * @author BUSKER-OTT */ public class USERINPUT { …

Member Avatar for JamesCherrill
-1
209
Member Avatar for lwisnas

[code] import java.util.*; import java.text.*; public class FactorialApp { public static void main(String[] args) { // create a Scanner object named sc and intializ variables Scanner sc = new Scanner(System.in); // perform Factorial application when user enters "y" or "Y" String choice = "y"; while (choice.equalsIgnoreCase("y")) { //get input from …

Member Avatar for hiddepolen
0
106
Member Avatar for rayden150

Hello, im sort of an intermediate programmer that has never installed a library on java before could anyone please tell me how to install this library on java so I could use the charts functionality, Please there are all sorts of folders in there I really dont know what to …

Member Avatar for ~s.o.s~
0
243
Member Avatar for solarmotion

The program already can compile and run. But, when we enter the film's code, an error will occurred. We had no idea how to solve it :\ [CODE] public class Entity { private String itemCode; private String title; private String description; private int language; private int time; private String productCompany; …

Member Avatar for Prateek nandan
0
418
Member Avatar for loserspearl

I have my program all working but whenever a user clicks cancel or exit I want the program to close, not throw my catch. Whenever a user throws a catch they have to input their answer twice before it will go back to normal operations. [CODE] import java.util.*; import javax.swing.*; …

Member Avatar for adarshcu
0
214
Member Avatar for vaironl

Hello forum, vaironl here. I would like to notify you all that I'm in an IB- Computer Science class (I'm learning a lot as I go, since I promise to skip the normal CS course). I would like to know if I could design this frame for my final project, …

Member Avatar for hfx642
0
107
Member Avatar for heybunny

am writing a program that plays rock paper scissor. The user will enter choice manually (rock is1, paper is 2, and scissors is 3) and the computer will chose one at random without letting the user know. The game will run as many times as the player wants. I can …

Member Avatar for ilovejava
0
2K

The End.