|
'a' is an instance and it is copied when you call m1().
'x' is a reference so when 'x' is used in m5() the original, not a copy is used.
The above is a simple explanation and it is not exactly true semantically but is true conceptually. But without understanding what you are trying to understand I don't want to explain what is actually going on.
|
|
|
|
|
hi
i would like to ask if its possible to run the selenium webdriver to attached to an existing opened browser.
i tried to do a simple google and varies tried the suggested result of using remotewebdriver and profiles but both didnt work as they still opened a new browser.
does anyone know how to do this?
|
|
|
|
|
help out with this question plz
|
|
|
|
|
You didn't say what help you need.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
am developing a spring mvc web application.
in WEB-INF/context.xml am not mensioning any path.then how to get the context path into the jsp.
If i have path="/abc" in context.xml then in jsp
<a href="${pageContext.request.contextPath}"/> gives context path in localhost as
localhost:8080/abc
but in my application we r not mensioning any path attribute in context.xml so how can i get
localhost:8080 path
modified 30-Jan-16 4:22am.
|
|
|
|
|
private method using inherit in class
|
|
|
|
|
Is that a question or a statement?
|
|
|
|
|
|
how to read large 8gb json text file in java program.
I am try with FileInputStream in java but after 2gb it's not work.
|
|
|
|
|
If you are trying to read all that much data into memory then it will never work. You need to read it in smaller blocks and process only the data you can hold in memory.
|
|
|
|
|
|
I'm using jena lib to translate rdf to java, but i have problem, how to get some property in java code using loop and i have array to save them. Thank you for your answer
This is my rdf code.
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#'
>
<rdf:Description rdf:about="http://somewhere/JohnSmith/">
<vCard:FN>John Smith</vCard:FN>
<vCard:N rdf:parseType="Resource">
<vCard:Family>Smith</vCard:Family>
<vCard:Given>John</vCard:Given>
</vCard:N>
</rdf:Description>
<rdf:Description rdf:about="http://somewhere/RebeccaSmith/">
<vCard:FN>Becky Smith</vCard:FN>
<vCard:N rdf:parseType="Resource">
<vCard:Family>Smith</vCard:Family>
<vCard:Given>Rebecca</vCard:Given>
</vCard:N>
</rdf:Description>
</rdf:RDF>
|
|
|
|
|
It is not clear what your problem is. The above would appear to be some XML formatted data, so you can use the XMLReader (Java Platform SE 7 )[^] to extract the fields from it.
|
|
|
|
|
The spark of current version is used FMJ library as media library,
and so the voice chatting can't progress.
If the libjitsi library replace fmj, I don't know it to be impossible.
|
|
|
|
|
|
I have one large json file in that each cv have two or more degree ie mention.
I want data that having 4 year degree is completed How to do that using java code.
in degree any thing mention like BA ,BCOm ,BS,MBA, MS, BE ,ME but I want those data having 4 year degree completed how to do that ?
Suppose In CV :::BA ,BCOm ,BS,MBA, MS, BE ,ME
these are the degree
Output is BE Because is 4 year other are 3 year 0r 2 year I want only 4 year completed how to do that ?
In Cv there are lot of other degree so how to calculate exact 4 year completed degree ?
is there nay idea ?
|
|
|
|
|
How did you tell BE is 4-year degree? There isn't enough information. You have to add one more piece of information say "length of study" for each degree.
Peter Leow
https://www.amazon.com/author/peterleow
|
|
|
|
|
There is no way to do it with just those letters, as they could mean anything.
|
|
|
|
|
Hello,
I have an application that needs to print the contents of a JPanel, and I using this code
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(new Printable() {
@Override
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex > 0) {
return NO_SUCH_PAGE;
}
int marge=30;
int x = (int)pageFormat.getImageableX();
int y = (int)pageFormat.getImageableY();
graphics.setFont(new Font("Times new roman", Font.BOLD, 14));
graphics.setColor(Color.BLACK);
graphics.drawString("ACTE DEMANDER\n", x + marge, y + marge);
panel.print(graphics);;
return PAGE_EXISTS;
}
});
boolean doPrint = job.printDialog();
if(doPrint) {
try {
job.print();
}
catch (PrinterException e1) {
JOptionPane.showMessageDialog(null, e1);
}
}
and it works well, but that code display the border of JTextArea, which is supposed to be borderless after being printed and the content of this JTextArea are not all displayed texts are cut.
So I decided to print one by one the contents of this JPanel but its content does not switch to the line as I did in my interface but it is superimposed one above the other.
this is my second code
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(new Printable() {
@Override
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex > 0) {
return NO_SUCH_PAGE;
}
int marge=30;
int x = (int)pageFormat.getImageableX();
int y = (int)pageFormat.getImageableY();
graphics.setFont(new Font("Times new roman", Font.BOLD, 14));
graphics.setColor(Color.BLACK);
graphics.drawString("ACTE DEMANDER\n", x + marge, y + marge);
jLabel1.print(graphics);
jLabel2.print(graphics);
jLabel3.print(graphics);
jTextArea1.print(graphics);
jTextPane1.print(graphics);
return PAGE_EXISTS;
}
});
boolean doPrint = job.printDialog();
if(doPrint) {
try {
job.print();
}
catch (PrinterException e1) {
JOptionPane.showMessageDialog(null, e1);
}
}
How then could I do to make them lines or retrieve the contents of my JTextArea whatever the length of the text and there is newline. All help in both cases are welcome.
thank you for helping me
Best regards.
|
|
|
|
|
|
You define a
discrete random variable X that assumes values represent your awards and losses when you play the
game. For simplicity, assume that the awards are positive and the losses are negative. Each award
or a loss is associated with a probability. You run the game many times, at each time you randomly
select a value for the random variable and multiply the result by its probability. After m runs of the
programs, your program must give a recommendation whether you play the game or not.
Remember if the expected value of the random variable is negative, it is a losing game; wining
otherwise.
You program should allow the user to input the values of the random variable and their associated
probability and the number of runs m. After doing the experiment, the program prints the
recommendation.
please help i cant do it!!!!!
|
|
|
|
|
Member 11384820 wrote: please help i cant do it! Can't do what? If you mean you can't do anything then I suggest you go to The Java Tutorials[^] and work through the tutorials. If you mean something specific (see How to ask a question[^]) then please provide the details.
|
|
|
|
|
We have a time values in CSV sheet, needs to generate a Graph for time values on X-axis and have to set a proper scale on Y-axis,
Graph should be in xlsx format, so we are converting csv to xlsx,but because of string or time/date data type it is unable to convert
complete data to xlsx which leads graph is not generating and also we are unable to fix a intervals on Y-axis.
Environment Using : Eclipse
|
|
|
|
|
Does this have anything to do with Java?
|
|
|
|