333 Answered Questions for the topic Java



In this game, one fly and three frogs are placed randomly on a board with the size 7x7.

In each iteration, they move randomly within the board and the simulation stops when one of the frogs eats the fly. Fly and frogs are essentially creatures that can move, make noise, and eat. Frogs... more


Time Zone Misunderstanding

Hi I suggested to the tutor for us to meet at 10am Saturday(today) for our session. When I logged into the system I saw that I was scheduled for 9am, not 10. Also, the tutor suggested moving the... more

natural merge sort with linked list in java

I am looking for sample code in java for a natural merge sort using linked lists. Doing the natural merge sort iteratively not recursively. Can someone help with this or point me to a resource... more


JAVA program need help today

 Develop an application that interviews a patient for some general medical history data using a binary tree to drive the process, implemented using the Java language and using the Java Swing... more


Java programming Tic Tac Toe

I need help with a java program that allows two users to play tic-tac-toe. The game should print out the board after each player enters their move, check to make sure the player enters a valid... more


Convert the following methods from Java to C and then write a function to test each output with at least 4 test cases to see if the method work correctly.

//Convert an 2D array to a string     String int2DArrayToString(int[][] input)     {         return Arrays.stream(input).map(x -> Arrays.stream(x).                 mapToObj(i ->... more

Sort a double dimensional array in java using scanner class.

Ex: Original Matrix 11 -2 3 5 16 7 9 0 4 3 1 8 Sorted array 16 11 9 8 7 5 4 3 3 1 0 -2


Provide an equivalent of the java class below in C

class CompSci {     static final int QuestionsTobeAnswered = 4;     static final int questionsGiven = 4;     int questionsAnswered;        public static void addToArray(int[] x)   ... more
Java Jdk


A Java Program to calculate the kinetic energy of a ball (check description)

BACKGROUND:A solid iron ball with a radius r and mass m is rolling on a surface without slipping with a constant linear velocity v and angular velocity ω. The total kinetic energy Kt of the ball is... more

I am getting an error that constructor "cannot be applied to given types"

Given this code:Main.java class Main { public static void main(String[] args) { SpecificThing mine = new SpecificThing(); System.out.println(mine.double_my_number()); ... more

Is an ArrayList a primitive datatype or non primitive?

Is an ArrayList a primitive datatype or non primitive?

Fill out Blank_A and Blank_B with Java code.

public Blank_A printMyMessage () { String threadName = Blank_B; System.out.println(threadName + " : " + this.myMessage+ ", i = " + ++i); }


Recursive Program

Write a recursive program called waysToClimb that takes a positive integer representinga number of stairs and prints (i) each unique way to climb a staircase of that height,taking strides of one or... more


Data Structure and Algorithm

An integer N>1 is called prime number if its only positive divisor are 1 and n; otherwise, n is called a composite number. For example, the following are the positive numbers less... more

How to complete code

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package... more

Modify the Cage class to implement Comparable.

The definition of the Comparable interface can be found here. Remember that Comparable has one abstract method, int compareTo(T o). Two Cages can be compared based on their size obtained via... more

Write a function in Java that takes in the int[] array, sorts it using bubble sort, then returns back the sorted array.

Examples: bubbleSort({4,7,1}) -> {1,4,7} bubbleSort({80,6,6,8,2}) -> {2,6,6,8,80} public int[] bubbleSort(int[] array) { int n = array.length; int temp = 0; }Finish the rest


6.34 LAB: Even/odd values in an array (Java)

Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers in... more

POS Design the system based- but is not limited to the technical and user requirements

A Point-of-Sale (POS) system is where your customer makes a payment for products or services at your store. The POS serves as the central component for your business; it’s the hub where... more


OOP with java coding required

Write a basic GUI input java program in which you have to take input from a user through GUI Message Box (Input Dialog). This information includes username, email address, password, gender, date of... more
Java Javascrips


Java code required

UBL bank provides income statements to its account holders upon their request on monthly basis. An Income statement includes the accountholder's account number, account tftle, total debft, total... more

Inheritance in java

There were Pandavs and Kauravs. Arjun and Bheem were Pandavs. Duryodhan was a Kaurav. Pandavs were characterized by their skills of fighting (fight ( )), obedience (obey ( )), and kindness (kind (... more


Objects, Properties and Methods

Think an object with many properties and methods except for gadgets.Example: PersonProperties - Age, heightMethods - Walk, Talk

I have a coding question

How do you capitalize the first character of each word in a string in an array?Explain with a simple example please?Thanks

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.