35,618 Topics
![]() | |
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); } … | |
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? … | |
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 … | |
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 … | |
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; … | |
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, … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
I need help on this pyramid (the one on the right)s | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
test for check more 5 items | |
{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 … | |
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 … | |
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): … | |
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 … | |
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 … | |
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 … | |
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 | |
Hi Guys, Can anyone share the code for HL7 integration with Java. | |
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 … | |
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 … | |
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>(); … |
The End.