170 Answered Questions for the topic Java

1d

Help is needed writing a simple JAVA class to check to see if a year is a leap year

A student wrote to me asking for help writing a JAVA program to calculate leap year. The assignment specified that the year must be evenly divisible by 4, but not 100. However, years divisible by... more

4d

Why is my java (Tiny Encryption Algorithm) program not working?

package com.teaAlgo;class TEA { // Variables static int sum = 0x0; static int delta = 0x9e3779b9; static int lText = 0x12345678; static int rText = 0x9abcdef; static int key[] =... more

5d

Generate random numbers within a range with pre-defined sum

What if I want to generate random numbers within a range with a fixed sum?? For example: I want to generate 50 numbers between 50 - 100 but with a fixed sum of 4650 so that I would produce a mean... more

5d

How to generate random numbers with specific mean

Is there any formula that I can understand which will allow me to generate random numbers with a specific mean. I'm using java. Thanks

8d

Java Programming Question: Intro to Computer Science

I'm working on a project for my computer science class in java and it is a travel agency. In one of the classes, Basket, I need to make an array of objects of type Reservation. But I also have to... more

12/20/19

Which Skills do the IT companies Looking for?

What are thing we sholud keep in mind to prepare ourselfs for IT companies job.

12/18/19

Explicitly create Class for joining table or not for Java JPA many-to-many relationships

Hi,For those who have used Java JPA (Hibernate or EclipseLink) I wanted to ask your opinion on the best way to represent m2m relationships in the Entity classes. The choice as I see it is to... more

11/10/19

Java String class

So we are given to write the exact output of the following code:class stri123{ public static void main(String[] args) { String name = "University Grants Commission"; boolean sword... more

11/09/19

Java Program / methods

One sales shop offer following discount rates to customers based on their bill value.Bill value Range Discount ratebill value >= 10000 discount 20%bill value >= 5000 disocunt 10%bill value... more

11/08/19

Java Number Patterns

How do we print,_ _ _ _1_ _ _2 1_ _3 2 1_ 4 3 2 1In Java?Please help, I don't know how to get started

11/08/19

My Java program will not run in the browser, no sound either. Why?

import java.applet.*;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.applet.AudioClip;@SuppressWarnings("deprecation")public class StopWatch... more

11/06/19

Java Programming applet

Hello, I have two assignments StopWatch.Java and Vote.Java. I'm supposed to use applet, but for some reason my programs don't run in the browser. Originally I was using Chrome and I found out that... more

10/26/19

Java Time Calculator Program Help

Write a program using JAVA and FINAL variables that asks the user to enter a number of seconds. There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or... more

10/12/19

Java - arrays & loops

Question : Write a Java program to read integer data set(size of n<10) into an array and display its data graphically by plotting each numeric value as a bar of asterisks as shown in the... more

10/03/19

Java Switch Case

How do we write the following code using switch statement ?if(option == 1) vehicle = "Motor Cycle" ;else if(option == 2) vehicle = "Car";else if(option == 3) || (option == 4)vehicle = "Heavy... more

10/03/19

Java Programming

Hi, I'm new to Java. I've been working on this question, wrote the code and checked the results with some examples and it seems to be doing fine. I would be glad if any of the tutors can check the... more

10/03/19

I have a session scheduled what do I need to do before

What do I need to do

10/01/19

Java Switch Case

Why is the output of the code 14, not 8 : alpha=3+5=8?public class Application4{public static void main(String[] args) {int alpha=3;int beta=5;switch (beta){case 3:alpha=alpha+3;case... more

09/30/19

why displaying parent objects by child class object only giving default values !!?

class one{ int age; String name;}class two extends one{ void display() { System.out.println(age+name); }}class extenddoubt{ public static void main(String args[]) { one o=new... more

09/27/19

Question on binary number. The input is n binary number in n different rows, find the unrepeated binary row.

Question on binary number. The input is n binary number in n different rows, find the unrepeated binary row.write java programe

09/19/19

C++ programming.

Algorithms -devising an efficient algorithm Write a function that is given an array of names and that removes duplicate names and keeps the remaining names in the order in which they first... more

09/13/19

How to allow users to input their own data.

I was taught a way to allow users to put in their own input instead of giving them a set variable. So instead of giving a user the set name "Sam" they could put "Dan" or "Shrek" etc... However when... more
1 3 4 5 6 7

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.