|
import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
String fileName="winner.csv";
File file = new File(fileName);
try
{
Scanner inputStream = new Scanner(file);
inputStream.next();
while(inputStream.hasNext())
{
System.out.println();
StringTokenizer data = new StringTokenizer(inputStream.next(),",");
while(data.hasMoreTokens())
{
System.out.print(""+data.nextToken());
}
}
inputStream.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
}
|
|
|
|
|
|
Hi all,
I know its slightly broad topic, but I struggle to code everyday... Like I would practice coding like 2 days in a row then suddenly I stop. This is honestly making it hard for me to get better at coding.
Any tips etc, my first step was to sign up to this forum so I can communicate with coders more often.
Thanks ! 
|
|
|
|
|
|
Hi, everyone!
On my job I have 2 work options:
1) Join Apache community and start working on one large open source project
pros: deep dive into java core(I've been working on another open source for 1 year already + 4 years in java)
2) Join team to create large microservices platform.
pros: gain experience in microservices with Spring Cloud, Docker, PostgreSql, Netflix framework.
What is the best option you think?
From future best employment perspective.
|
|
|
|
|
If you toss a coin to choose the answer will be just as valid. People here are unlikely to be able to foretell the future.
Choose the option that you will most enjoy working on and go from there.
|
|
|
|
|
Алексей Кузнецов wrote: Join team to create large microservices platform.
This will in general be a more employable skill.
Specialization in one library works well if a company wants that specialization but more want general knowledge instead. Micro-services, if you actually do that end to end, provide a general knowledge of more technologies along with the micro-services idiom itself.
|
|
|
|
|
I have four simple computations in my program. All integer results. I want the output to be right justified but it ain't looking that way.
Right now the 5 underneath the 30 looks like it's being placed between the 3 and the 0 (in the above number 30). The -10 looks like it is being correctly right justified. The -10 looks like it is being correctly right justified with the 30. And the 200 takes up the maximum field width of 3 which I have set.
My output has a ragged right appearance so I don't know where I'm going wrong.
My code looks like this:
public class FormattingOutput
{
public static void main(String args[])
{
int a, b, c, d;
a = 10 + 20;
b = 10 - 5;
c = 10 - 20;
d = 10 * 20;
System.out.printf("%3d%n", a);
System.out.printf("%3d%n", b);
System.out.printf("%3d%n", c);
System.out.printf("%3d", d);
}
}
|
|
|
|
|
I know now. You have to use a fixed width font in your console. I wasn't.
|
|
|
|
|
Your output sentence is wrong.This is JAVA ,is not C.
|
|
|
|
|
I have a java application that uses jar files Jetty, Jersey, hazelcast, and etc. I am trying to create an uber jar out of it that can : 1- execute using java command 2- can be imported into new project’s class path
I have tried One-Jar, but since it uses a class loader, when the One-Jar is added to a project’s class path in eclipse, eclipse does not recognize the content of the jar files inside the One-Jar.
|
|
|
|
|
You could extract all the files from each jar (see jar -xf) and create a new jar file from those files.
|
|
|
|
|
Member 13909994 wrote: I have tried One-Jar, but since it uses a class loader
If you have a custom class loader (yours or someone elses that you are using) then it seems very likely that you are using it incorrectly in relation to jars if eclipse is not loading the jar (tagging missing dependencies.)
If you are not using a custom class loader then your mention of that is not clear.
|
|
|
|
|
I have tried everything I can think of to get my project to work but I cant figure it out. Does anybody know how to solve this project:
Create an application that uses a graphic interface to capture employee data and
writes that data to a random access output file. The data required for each
employee includes an employee ID number from 1 through 99 inclusive, the first
and last names of the employee, and the employee’s hourly pay rate. Allow the user to enter data one record at a time and to click a button to save each record.
Save the class as CreateRandomEmployeeFile.java.
b. Create an application that allows the user to enter an employee ID number.
When the user clicks a button, display all the stored data for the employee. Save
the file as ReadRandomEmployeeFile.java
Any help will be greatly appreciated. Thank you.
|
|
|
|
|
|
What is runtime polymorphism or dynamic methode dispatch ?
|
|
|
|
|
|
Hi, May I ask if any of you know the code for linking between two activities and the code for a search bar? Thanks!
|
|
|
|
|
|
So, I am in the process of developing a library that can open, edit, and save WAV files, called JWAVE. I have implemented the first method, changeSpeed(), and it works very well. It's fast and accurate, but only when the change in speed is positive. Generally, when the change in speed is negative, and it repeats samples every so often to emulate slowing down, it is rough.
What is the best way to interpolate to make it as smooth as possible? Here is the GitHub:GitHub - Donald-Tho/JWave: like WaveFile, but not.[^]
|
|
|
|
|
|
Do I need a real strong super duper fast computer with a Zillion Zigabytes of memory in order to use Android Studio?
The reason I'm asking is because I've just fired it up on this small netbook computer of mine, and he spent 2 minutes and 15 seconds building something called Gradle Scripts.
I also noticed that he is very very slow to respond to clicks.
When I click on "help/about", he needs between 10 and 20 seconds to respond
Can someone tell me if I need a multiple core machine with a whole lot of memory in order to use Android Studio?
Details below...
==+==+==+==+==+==+==+==+==
Android Studio 3.0.1 Build #AI-171.4443003, built on November 9th, 2017
JRE: 1.8.0-152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 8.1 6.3
Computer is...
Acer Aspire E11
Intel Celeron Processor N2840
Intel HD Graphics
2 GB DDR3 L Memory
250 GB HDD
|
|
|
|
|
You probably need something considerably more powerful. I would suggest a minimum of an i5 processor with at least 4Gb of memory. Disk space and speed are less important.
BTW there is an Android forum below, under the 'Mobile' leaf.
|
|
|
|
|
Richard MacCutchan wrote: there is an Android forum below,
Thanks. I'll be there within the hour
|
|
|
|
|
Hi Everyone,
I want to learn Java Card. Can any body guide me in right direct to begin with? I have searched in google and Oracle site, but couldn't find a simple and better start.
Thanks in advance.
Saravana Bhavan D.
|
|
|
|