|
Hello guys
I hava an "Order list"
I need to Delete The First Number
public void delFirst()
{
}
public void delLast()
{
if (!isEmpty())
{
size--;
}
}
|
|
|
|
|
none of that actually tells us out here what the underlying storage type you're using is - an array or a list - its pretty ambiguous, so the answer would vary
for a list, you could do
myList.remove(0);
for an array ? hmmm.. this would copy from the element [1] onwards in the oldArray to element [0] in a newArray - you then have to think about replacing oldArray with newArray .. and, Im not sure wether this copies elements or references, or even if it will compile
somedatatype[] newArray = new somedatatype[oldArray.length-1];
System.arraycopy(oldArray,1,newArray,0,oldArray.length-1);
.. but the gist in this case is create a temp array, copy your items to it shuffling 'up' by one element index, then move the data back to the original array
have fun (ps - I try not to code in java, so there could be holes big enough to drive a truck through in my suggestions)
|
|
|
|
|
i want to create a simple UI that displays simple files from the server.
Files like word documents, pdf files and pictures.
there is no option to delete or edit the files but just to view the files.
what programming language should i use to create such a UI.
currently i am trying to do it with java.
finally i like to replace it with the android i have on my tablet. How can i replace it?
|
|
|
|
|
This is an impossible question to answer, please read http://www.codeproject.com/Messages/3137511/Forum-Guidelines-PLEASE-READ.aspx[^]. You need to go and research the features you are interested in, spend time studying the language and think about the design of your application. I notice also that you have posted this question in three forums; please post in one forum only, you will get just as many good replies.
|
|
|
|
|
I am a .NET programmer with years of experience. My new job will pay for accredited online courses. I would really like to expand my knowledge by learning Java.
Already know the basic as I program in C#. Would like to find a program that maybe has an advanced course.
Can anyone make any suggestions?
Where I live has two colleges but no programming classes...what's up with that???
Looked at things like University Of Phoenix but doesn't really seem like I would learn anything there.
Would really like a course that is very hands on and has assignments that have to be completed and graded...not a course that you read a bunch of useless material and take a test.
I have already went thru a few books which are all about the same but still feel I am not getting near the level I have with .net
modified 24-Oct-14 15:43pm.
|
|
|
|
|
Hi,
i just want to know that how to create master page and content page using java code?
Is there any tool like ASP.NET to directly make master and content page using drag and drop option.
please help me..??
|
|
|
|
|
|
Hello I am having some trouble figuring out what is going wrong in my code here, I need to get this to display all the perfect numbers from 1 - 10 000 on the console and am unsure what exactly is going wrong as I am not getting any output, I am a newbie and here is my code I have for it so far (I am new to this board so I apologize if this is the wrong place to post this):
int num = 3;
int y = 2;
int sum = 0;
while (num < 10000) {
while (y < num) {
int x = num % y;
if (x == 0) {
sum += y;
}
y++;
}
if (sum == num) {
System.out.println(num);
}
num++;
}
|
|
|
|
|
Your algorithm for calculating a perfect number is not correct; see http://en.wikipedia.org/wiki/Perfect_number[^]? You also need to initialise the values of y and sum at the beginning of each iteration of your major loop.
|
|
|
|
|
Run this Code
package p1;
import java.io.IOException;
public class perfect
{
public static void main(String[] args) throws IOException
{
int stnumber = 1;
int ennumber = 10000;
System.out.println("Perfect Numbers between "+stnumber+ " and "+ennumber);
for (int i = stnumber; i <= ennumber; i++)
{
int number = i;
int sqrt = (int) Math.sqrt(number);
if (sqrt * sqrt == number)
{
System.out.println(number+ " = "+sqrt+"*"+sqrt);
}
}
}
}
|
|
|
|
|
Is it possible to scroll JFrame if so den how?
|
|
|
|
|
|
I m not able to add the external jar into classpath....can u plz help me....
error-Could not write file: .classpath.
|
|
|
|
|
Classpath is not a file it is a parameter specification to the javac or java commands. What exactly are you trying to do?
|
|
|
|
|
1) Integer currentGroupId = Integer.valueOf(-1);
2) currentGroupId = Integer.valueOf(rs.getInt("CONSUMER_GROUP_ID"));
Please explain both of it
|
|
|
|
|
Please post your question once only. Also, you can refer to the documentation[^] for basic questions.
|
|
|
|
|
1) Integer currentGroupId = Integer.valueOf(-1);
2) currentGroupId = Integer.valueOf(rs.getInt("CONSUMER_GROUP_ID"));
Please explain both of it
|
|
|
|
|
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
filepath ="/home/GUI/Language_Independent/Output/Frame_1.txt";
file =new File(filepath);
fileContents="";
try
{
br = new BufferedReader(new FileReader(filepath));
}
catch(Exception E)
{
jLabel1.setText(E.toString());
}
try
{
while((fileContents= br.readLine())!=null)
{
System.out.println("fileContents");
jLabel1.setText(fileContents);
String str = "a";
while(br.readLine()== str) {
jLabel1.setForeground(Color.red);
}
}
br.close();
}
catch(Exception E1)
{
jLabel1.setText(E1.toString());
}
}
Frame_1 consist of generate text eg:abcdefgh..
for this generated file i want to set color for specific char eg a=red so on.
jLabel1.setForeground(Color.red);
is not working at all.Please someone suggest and thnks in advanced
|
|
|
|
|
Your test in the sub loop probably never yields true. Have you stepped through your code with the debugger?
|
|
|
|
|
ya i also observed it is not going inside the loop condition is not satisfied but i can solved it out is my logic wrong ?
|
|
|
|
|
Your logic does not make much sense. You read a line from the file, then you are trying to use a while loop to read another line of text and compare it with the string a . You should read a line and then test if it contains the character you are looking for. However, note that you cannot set different characters to different colours. You can only use a single colour for the entire label.
|
|
|
|
|
i want to display a word file into my application.
It is like extracting the text to put in JTextArea.
Help what best API can use?
an easy to understand!
|
|
|
|
|
|
Quote: how to display panel just below input panel.?
|
|
|
|
|