Home >

java

Advertisement
  • find largest number given a numberJanuary 16

    Given a Integer, I need to find the maximum number that can be formed from the digits. Below is the code I have: private static long findLargestNumber(int data) { int num = data; int[] times = new int[10]; while (num != 0) { int val = num % 10; times

  • Method working over two different connection types [on hold]January 16

    I have two connections TCPMasterConnection SerialConnection and two transactions ModbusTCPTransaction ModbusSerialTransaction package modbus; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import net.wi

  • Creating a chess boardJanuary 16

    One of my assignments was to create a chessboard. In this assignment I could not use an array, or a form of list or what not. Below is my code for the creation of the chessboard: import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.

  • Colors compare with "==" in Java [on hold]January 16

    Good morning, I need to check if an object's color is the same of another's color. I tried the most classical way to do it. Here is how: boolean Color checkColor() { if(obj1.getColor()==obj2.getColor) return true; else return false; } In another meth

  • Implement PageObjects using TestNg in seleniumJanuary 15

    I am trying to implement page objects with Page factory using TestNg and selenium. Please advice improvements in it. Classes: LoginPageObjects extends LoginPageLocators { private WebDriver driver; public LoginPageObjects(WebDriver driver) this.driver

  • Replace word with another word excluding the word contains substring of the given word [on hold]January 15

    I want to replace a with value1, b with value2, c with value3 but the below code is replaced as int a, b, c; void add() // code to add { this.a = 78; this.b = 89; this.c = a + b; System.out.println("sum of two numbers is "+c); } int value1, valu

  • RSS to JSON for insertion into MongoDBJanuary 15

    In my code, there is a chain of functions call where the deepest function may throw an exception. I catch and handle it according to the business logic. The problem is that all other functions in the call chain are dependent on this function, thus, i

  • Passing connection for multiple classes/methodsJanuary 15

    I have made a connection method which returns TCPMasterConnection. public Class Connect{ String ipAddress; int port; TCPMasterConnection tcpCon; public TCPMasterConnection OverTCP(String ipAddress, int port) { this.ipAddress = ipAddress; this.port =

  • Cannot change maven version in eclipseJanuary 10

    After failing to mvn package inside of eclipse but succeeding in the terminal, I realized that eclipse was running maven 3.3.3 while terminal was running 3.3.9. I attempted, and by all apparent accounts succeeded, to reconfigure eclipse by going to E

  • Rendering sprite of 8 monochromatic colorsJanuary 7

    I want a 16x16 monochromatic sprite to be displayed on my screen. The sprite has 8 different shades, which correspond to 8 different colours. Each color can have his own shade as well, but I want to limit that to 8. So instead of FF00FF, I want it to

  • C++: from LWJGL to C++ with OpenGLDecember 24

    I've been trying my best on porting my 3D game from Java to C++, but to no avail. I use only LWJGL with OpenGL but I cannot find any other library in C++ that supports as much as LWJGL does for Java. Especially on the math part. For instance. I'm try

  • What is the code for panning a camera from touch input? (libGDX + scene2d)December 24

    I would like the user to pan around a game world by dragging their finger on a touch screen - just like Google Maps. I tried a few things but I'm not having much success thus far. Here is where I'm up to. public class Game extends ApplicationAdapter

  • Need get help java paypal payments coding is NOT SPAM as computer thinksDecember 22

    java coding paypal project with java trading app need paypal payments code share with so many others with same needs INCLUDES ALL SAMPLE JAVA CODE I COULD FIND TO MAKE EASIER described at: hiringfreelancernedded.blogspot.com/ no more freelancers Java

  • How often 'Open for extension but closed for modification' principle is followed in OOP?December 22

    I find it more convenient to 'modify'existing classes rather than extending it. Thus, I violate the open closed principle of 'not modifying the compiled and tested source code, instead extending the functionality'. I feel comfortable in modifying the

  • Use of ignored in Java exception handling [on hold]December 10

    In my code, there is a chain of functions call where the deepest function may throw an exception. I catch and handle it according to the business logic. The problem is that all other functions in the call chain are dependent on this function, thus, i

  • JAVA - Modbus 1 connection for multiple methodsDecember 9

    I have made a connection method which returns TCPMasterConnection. public Class Connect{ String ipAddress; int port; TCPMasterConnection tcpCon; public TCPMasterConnection OverTCP(String ipAddress, int port) { this.ipAddress = ipAddress; this.port =

  • Implementing a Queue using a Linked List

    Implementing a Queue using a Linked ListDecember 9

    public class LinkedList { private class Node { private final T data; private Node next; public Node(T data){ this.data = data; } public void displayNode(){ System.out.println(data + " "); } } private Node first; private Node last; public boolean

  • Data hiding in video encryptionDecember 8

    I'm currently doing my major project in video encryption. I absolutely have no idea where to start from. So please if anyone can guide me, it would be really helpful. Algorithm is AES and language i thought is java. Is it possible to implement and an

  • Java Memory Reference to Itself from Inner VariableDecember 7

    If i have class A and B. Then A has object of B as below and B has reference to A. class A extends Activity{ private B objectB; } class B{ private A objectA; } When A class is destroyed, its variable objectB should be destroyed as well. So what happe

  • How to save a static variable with Javascript even when refreshing pageDecember 5

    In the following code, I would like to save chrono time even when i reload the page. The variable to save as static is "diff". Because i need my chrono to return me the las time saved when i redirect to the same page. this code is declared in th

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.366 s.