163 Answered Questions for the topic Java


Which Skills do the IT companies Looking for?

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


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


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


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


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


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


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


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


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


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


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

What do I need to do


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


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


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


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


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


How to convert?

Write a program which asks the user to enter a number of meters and convert that value to miles, yards, feet, and inches. The conversion factor is 1 inch = 2.54 centimeters. Display your results to... more


Programming style in Perl?

I work in Java so basically I use OOP paradigm during coding.I am about to start working in Perl and I was wondering what is the paradigm that Perl developers follow.In wiki it mentions that it... more


Display 1,2,3,4,5,6,8,10,11 as 1-6,8,10-11?

> I have this sequence **1,2,3,4,5,6,8,10,11** > > Expected output is **1-6,8,10-11** This problem is about formatting the sequence in easy readable form I tried with c# and used many... more


How can I simplify this set of if statements? (Or, what's making it feel so awkward?)?

My colleague showed me this piece of code, and we both wondered why we couldn't seem to remove duplicated code. private List<Foo> parseResponse(Response<ByteString> response) { if... more


Fastest way to get sign in Java?

I'd like to get the sign of a `float` value as an `int` value of -1 or 1. Avoiding conditionals is always a good idea in reducing computational cost. For instance, one way I can think of would be... 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.


Find an Online Tutor Now

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