493 Answered Questions for the topic Java

Recursion and Stack Overflow Question

Recursion uses something called the “call stack” where recursive calls to functions are stacked. Explain this using a specific example. When might there be a stack overflow?
Java Cse

05/13/21

Please help!! Gives answer in details

Is it possible for a method within an interface to be marked as final? Why or why not?Explain in details.
Java

05/09/21

There is a 2D-rectangular MxN Terrain

On each square of the terrain, there may or may not be some gold and a Monster. Each monster has a name and damage (a numeric value between 1- 10). Some Heroes are traversing on the terrain. Each... more
Java

05/06/21

There is a 2D-rectangular MxN Terrain

On each square of the terrain, there may or may not be some gold and a Monster. Each monster has a name and damage (a numeric value between 1- 10). Some Heroes are traversing on the terrain. Each... more
Java

05/02/21

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
Java

04/24/21

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

04/23/21

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

04/17/21

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

Simulate a selective repeat flow control mechanism using client server socket programing

can use any programming language of choice.
Java

04/15/21

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

04/09/21

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

04/08/21

Converting C to Pep9

Translate the following C program to Pep9 assembly language exactly as a compiler would translate it. Do not show the generated machine language code. #include <stdio.h> const int NUM1 =... 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

04/04/21

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

03/31/21

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); }

03/23/21

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

03/21/21

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

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

02/08/21

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

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.