35,618 Topics

Member Avatar for
Member Avatar for Heung min

import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class DataStreamExample { public static void main(String[] args) throws IOException { File f = new File("seminar.txt"); if (f.exists()) { BufferedReader br = new BufferedReader(new FileReader(f)); String dat; StringBuilder text = new StringBuilder(); while ((dat = br.readLine()) != null) { text.append(dat); } …

Member Avatar for JamesCherrill
0
283
Member Avatar for Daniel_84

A ___ is used to document the design of a class. (2 words) Identifying objects, attributes, and behaviors is called _____ . Encapsulation is also called _ _ _ _ _ _ _ _ _. (not data hiding) Which of the following are not allowable modifiers for an outer class? …

Member Avatar for sandy_5
0
302
Member Avatar for lashbandi

HI.. i had started a thread before about the same code...not sure if i was suppose to keep going in the same one or create a new thread..i am sorry if i did anything wrong mods... my program should just ask the user to enter words.. "The program must simply …

Member Avatar for sandy_5
0
12K
Member Avatar for dmanw100

I'm trying to read in from a .txt file with a Scanner (see code). For some reason this line of code will never execute even though it can open the file and there is, in fact, data in it as such: Name Name Number Number [CODE] File playerFile = new …

Member Avatar for JamesCherrill
0
968
Member Avatar for J_5

import java.util.Scanner; public class Rational { private int numerator; private int denominator; public Rational() { numerator = 1; denominator = 2; } public Rational(int numerator, int denominator) { this.numerator = numerator; this.denominator = denominator; } public int getNumerator() { return numerator; } public void setNumerator(int numerator) { this.numerator = numerator; …

Member Avatar for JamesCherrill
0
332
Member Avatar for memegha123

hI! I m trying to create a simple login application in jsp where i create a session allows the user to use certain features and then logout. Problem is that after the user logs out. I destroy all session objects and invalidate the session and redirect to welcome page still, …

Member Avatar for youngbill
0
3K
Member Avatar for Violet_82

HI guys, as I was playing with observers today I came across something interesting. I have a program which keeps a list of users (Observers) and products (Observables) and the idea is that whenever the availability (that's a property of a product) changes the Observers are notified of this change. …

Member Avatar for Violet_82
0
1K
Member Avatar for Violet_82

hi guys, I've come across observers while working ona very very large project, and I didn't quite understand how they were structured and I suppose this had something to do with the huge size of the project itself. Anyway, I then decided to delve a little more into that, I …

Member Avatar for JamesCherrill
0
357
Member Avatar for Ashley_16

This is my code, which changes by frame, I need to do a scoring system, but when I used the following code to add a score it works fine for the first 2 frames then doubles and by the end it's like 229. Thank you for any help. Score; var …

0
251
Member Avatar for Cory_3

I am trying to do my first 2d game in android studio, just for fun and experience, but I am having a major problem. What I want to do is start from a title screen with two buttons, 'Play Game' and 'High Score' (it's obvious what these buttons do. Where …

Member Avatar for John_165
0
611
Member Avatar for SimonIoa

Hello i want to run my Ionic Project on my android device when i run `ionic cordova run android` on node.js command prompt i am getting this error ..... [14:26:25] webpack finished in 8.20 s [14:26:25] sass started ... Witout `from` option PostCSS could generate wrong source map or do …

Member Avatar for SimonIoa
0
3K
Member Avatar for Sydrick James
Member Avatar for nishto

I want to fetch invoice data from two tables table a is in single row and table b data should be multiple rows single data is fetching correctly but facing problem with table 2 multiple data fetch. php file <?php $connection= mysqli_connect("localhost","root","","invoice"); $invID = $_POST['ID']; $Invo = "SELECT a.in_no, a.client, …

Member Avatar for Dascal_1
0
1K
Member Avatar for John_192

I have an Epson receipt printer (Model number: TM-T88V), but I cannot use it. I do not have a POS (point of sale) software that will let me do what I need to do, nor do I have the knowledge I need to understand the developers guide manual that comes …

Member Avatar for rproffitt
0
824
Member Avatar for Mr.M

Hi Dw. This is my first Android app, and what I'm trying to do is to post a POST/GET method to my webserver using Http in Android studio. I also have a Textview which suppose to display echoed data from server which will be a response to a request since …

Member Avatar for Mr.M
0
727
Member Avatar for Liviniesh

Define a class named Pair where the data(state) part contains two double-typed numbers, num1 and num2. The method(behaviour) part contain the following methods: o getSum() – returns the result of adding num1 with num2 o getdifference() – returns the result of substracting num2 from num1 o getProduct() - returns the …

Member Avatar for happygeek
0
367
Member Avatar for abhijeet P

Hello all, I have a code to encrypt data in C# and I want it to b decrypted in Java... following is the C# code [CODE]string Encrypt(string textToEncrypt, string key) { RijndaelManaged rijndaelCipher = new RijndaelManaged(); rijndaelCipher.Mode = CipherMode.CBC; rijndaelCipher.Padding = PaddingMode.PKCS7; rijndaelCipher.KeySize = 0x80; rijndaelCipher.BlockSize = 0x80; byte[] pwdBytes …

Member Avatar for JamesCherrill
0
9K
Member Avatar for fatima_7

hi how can change the size of image: from CSS for three pages using dreamweaver ? how can i (position and reposition something in the page)? i tried this tag, but nothing change: img.resiz{width:200px;height:1000px; what is missing ?? should i include the img link? and what will be the correct …

Member Avatar for Tarek_2
0
276
Member Avatar for Kang_1
Member Avatar for Saida_1

{public RestaurantBill() { //Create DecimalFormat object DecimalFormat formatter = new Decimal("#0.00"); // Initialise instance variables //Declaring variable(s). double bill= 0.00; double billtip= 0.00; double billtax= 0.00; double total= 0.00; //Initializing variables. //Obtaining user's current amount without tax and tip. System.out.println("Enter the amount of your restaurant bill."); bill = input.nextDouble(); //Calculating …

Member Avatar for Reverend Jim
0
312
Member Avatar for ekka

hello guys I want to know about dependency injection in angular 4 and spring , so I gonna start with what I know : in angular 4 we inject the dependency by setting the service ( or something else ) in the constructor's arguments of component, and despite we inject …

0
287
Member Avatar for Ellena

class robot: def __init__(self, length = 20.0): self.x = 0.0 self.y = 0.0 self.orientation = 0.0 self.length = length self.steering_noise = 0.0 self.distance_noise = 0.0 self.steering_drift = 0.0 def set(self, new_x, new_y, new_orientation): self.x = float(new_x) self.y = float(new_y) self.orientation = float(new_orientation) % (2.0 * pi) def set_noise(self, new_s_noise, new_d_noise): …

Member Avatar for JamesCherrill
0
800
Member Avatar for Daniel_84

I'm having problems compiling my program, I was wondering if someone could tell me where I went wrong and how to fix it. I would be deeply apreaciative of your help!!!! :) import java.util.Random; import java.io.Console; class project2_0 { int[] race = new int[70]; int tortoise; int hare; Random randomnumbers …

Member Avatar for JamesCherrill
-1
1K
Member Avatar for screenedcreamy

I have this use case where in I would need to dynamically create java objects out of json input and insert the data into sql tables. I tried using gson APIs but unfortunately we need to specify strucuture of that class (Car.class). Is it possible to dynamically achieve the above …

Member Avatar for Tarek_2
0
368
Member Avatar for Elifas

This time we would like the user to enter the following details for 3 items: name, cost price and quantity. Your program should the print out a receipt including a tax amount of 11.75% on the subtotal of all the three items entered. The receipt should be formatted in columns …

Member Avatar for JamesCherrill
-2
140
Member Avatar for Revanth_1

hi i am trying to take an n number of inputs from user where n is user defined .i am a bit confused how to write my jsp so it can as many as inputs required by the user

0
236
Member Avatar for vinoth_6
Member Avatar for vinoth_6
0
100
Member Avatar for Kenny_4

Hi everyone, I'd like to ask for help modeling my JPA entities and their relationships with each other. I use more abstract class names as class names in my project[](https://phonty.com/), so I'm going to translate that into a "more tangible" example. I start from a festival where several gigs take …

0
175
Member Avatar for Violet_82

Hi guys, I'm playing around ith optionals a little, but I'm not surewhether this is the correct behavious as I'm getting a null pointer exeption (I thought the point of Optionals was not to get a null pointer.) SO I'm setting an object to null and before calling toString on …

Member Avatar for Violet_82
0
388
Member Avatar for John_165

I trying to write a `spring batch` using `SpringBoot`. At first the program will read data from database, then write it to `.csv` file format. This is the code I have tried **Reader** @Bean public ItemReader<A> Reader() throws Exception { List list = new ArrayList<>(); JdbcCursorItemReader<A> reader = new JdbcCursorItemReader<A>(); …

Member Avatar for John_165
0
372

The End.