Home >

java

Advertisement
  • How to run .jar fileMarch 27

    I am currently running Windows 10 and am trying to open several installer .jar files for a game. In order to open the, I downloaded Java as that seems to be the most straight-forward way to do so. However, I am unable to actually "open" Java, I

  • Why should parentheses be used in an if statement?March 21

    My document says: This is incorrect: if b == 1 This is correct: if (b ==1) It says that the parentheses forces the expression inside to be evaluated first. Why does this matter? --------------Solutions------------- It is a syntactic requirement. The

  • Java REST WS with DBMarch 12

    I want to get the feedback this code about the best practice I should follow and if I am using the connection pooling properly. I have classes as follows: DAOConnectionFactory- to fetch pooled connections from the Datasource WatcherService- the REST

  • How can I implement the algorithm in the picture properly? [on hold]

    How can I implement the algorithm in the picture properly? [on hold]March 11

    String n1="1010100000000010",n2="10000111"; int div=Integer.parseInt(n1,2); int divisor=Integer.parseInt(n2,2); int div_Hi=0; for(int i=0;i<8;i++){ dividend<<=1; if(dividend_Hi>=divisor){ dividend_Hi-=divisor; dividend=divi

  • Unfortunately the app has stopped in Google maps ExampleMarch 10

    I have seen all answers but still i get the "Unfortunately the app has stopped". My mainactivity.java package com.example.googlemaps; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google

  • Encapsulation for Reference Variables?March 9

    It may be a common qustion but i couldn't find nice explanation for it. I am trying to understand the encapsulation of reference variables in Java. In the below code: class Special { private StringBuilder s = new StringBuilder("bob"); StringBuil

  • Unable to access Inner Interface of classMarch 6

    I have an adapter class for recyclerview: public abstract class RecyclerViewArrayAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> { ... } I am creating an object like this : new RecyclerViewArrayAdapter<String

  • Is there a way to input a unicode value and output its respective char?March 5

    I have here some code trying to output seat numbers. The output is formatted as such for numRows = 2 and numCols = 3: 1A 1B 1C 2A 2B 2C My problem below is with my char.forDigit method. What I am trying to do is input Unicode values (65 being A, 66 b

  • How can I set a Steam achievement in Steam via LibGDX or native Java?February 14

    Is it possible to set or 'unlock' a Steam achievement via LibGDX or with a native Java solution? If so, how it this possible. Furthermore, what would be a good implementation for 'saving' achieved achievements when you were offline. For example, when

  • Recursively defined instance variables?February 9

    I'm in the midst of learning and understanding the structure of Java (coming from Python) and am having some difficulty building an Infix Calculator. I a Calculator, BinaryExpression, ExpressionManager, Number, Operator, and Token classes and an Expr

  • Should I use import java.util.* for bringing in just one class?February 9

    when we import the Scanner class to a program which is the best and most suitable method from these two? import java.util.* import java.util.Scanner I'm a totally newbie to the programming and I haven't any idea about choosing the best method. person

  • 'Native code library failed to load' [on hold]February 8

    I am using an external jar called LeapMotion to create a simple Java Application using Eclipse. However, I have this error: Native code library failed to load. java.lang.UnsatisfiedLinkError: no LeapJava in java.library.path I've had this error for a

  • Floating point calculation being too exactFebruary 8

    In Java, I've run this method: private static void floatAddition() { float a = 0.1F, b = 0.2F, c = a+b; System.out.println(a + " + " + b + " = " + c); } and the result is 0.3 for floatAddition. I'm now trying to get behind why it is ad

  • Is it appropriate to not follow the O/C principle if you have unit test coverage?February 8

    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

  • 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

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