|
|
|
Quick, run round and give three conflicting answers (all worng, of course).
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
2.1Design a class named House that holds the street address, asking price, number of bedrooms, and number of bathrooms in a house. Include methods to get and set the values for each data field. Create the class diagram and write the pseudocode that defines the class. [20]
2.2 Design an application program that declares two House objects and sets and displays their values
|
|
|
|
|
Sorry, this site is not here to do your work for you. If you do not understand the questions then you should talk to your teacher, or consult your course notes.
|
|
|
|
|
how to i create connection between ms access file to java ?
and how i to call that .mdb file ?
actually i want to read a questions one by one by this file .mdb
|
|
|
|
|
|
hello everyone,
I need help regarding a copy paste issue from excel file to an application which opens on Java platform.My company has given me a spreadsheet of 3000 forms and I am supposed to copy all the data from excel spreadsheet to company software which opens on java platform. I was given 4 days and 2 days has past and till now i have completed only 600 forms ,it is really time consuming and streesfull work.I was hoping if anyone can help me out in any way so that i can complete the task fast.And if someone helped me out I will share the prize in half.I have got some ss of the company software and excel file
|
|
|
|
|
i have searched a lot but couldn't find relevant answer. when i open class file using "jdgui" software then actual code appears as it is. i want to protect my logic from decompilation. Any help will be appreciated. Thanks in advance
|
|
|
|
|
|
I already searched but which one is perfect ? like i have tried Proguard that keep static string values as it is. can you suggest me which one will help me ?
|
|
|
|
|
Renu Meena wrote: can you suggest me which one will help me ? Sorry, I have no idea which is best; you need to research the options and decide for yourself. But you may find that it is not worth the effort unless your code is really that important.
|
|
|
|
|
Sorry to say but if you do not have solution then do not reply with invalid suggestions
|
|
|
|
|
I gave you a perfectly valid suggestion. Whether you do something about it is entirely up to you. But please remember, you do not pay for this service, and we are all volunteers giving support free.
|
|
|
|
|
Renu Meena wrote: I already searched but which one is perfect
If it runs on my computer I can always reverse engineer it.
If you want to protect your intellectual property then create a service not a product.
|
|
|
|
|
Yeah. you are right but i am bind to provide product only because it is hardware related issue
|
|
|
|
|
Hi I wrote a method for determining whether an integer is a palindrome like below. and for the input number -2147483648 I get true as it's output but in reality the output should be false. It seems the Collections.reverse(list) in my method doesn't work, I mean it doesn't reverse the input. I appreciate if someone can help my problem.
<pre> public boolean isPalindrome(int x) {
String raw=String.valueOf(x);
if(raw.charAt(0)=='-')
raw=raw.substring(1);
List<Character> list = new ArrayList<Character>();
for(char c:raw.toCharArray())
list.add(c);
List temp=list;
Collections.reverse(list);
return temp.equals(list);
}
modified 12-Mar-18 16:29pm.
|
|
|
|
|
ElenaRez wrote: my method doesn't work. Please explain exactly what that means.
|
|
|
|
|
I mean if you test the program with the input number -2147483648 the result according to my method implementation will be true while in reality as you see the mentioned number is not palindrome and the result should be false. I can't understand what is the problem in my code.
|
|
|
|
|
The problem is the following line in your code:
List temp = list;
which does not create a copy of the original, but just a new reference. So when list gets sorted, temp also points to the sorted elements.
To create a copy of the original you should replace the above line with the following:
List temp = new ArrayList<Character>();
temp.addAll(list);
|
|
|
|
|
Thank you so much for your great answer.
|
|
|
|
|
Hello. I have written a code like below for Valid Parentheses problem. and after running it, I get error such: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space in the line where I push in the stack. Could any one help what is the problem?
class Solution {
public boolean isValid(String s) {
Stack<Character> stack = new Stack<Character>();
int i=0;
boolean result=false;
if(s.length()==0||s==null) return true;
while(i<s.length()){
if(s.charAt(i)=='('||s.charAt(i)=='{'||s.charAt(i)=='[')
stack.push(s.charAt(i));
if((!stack.empty())&&(s.charAt(i)==')'||s.charAt(i)=='}'||s.charAt(i)==']')){
if(stack.peek()==s.charAt(i)){
stack.pop();
i++;
continue;
}
else
result=false;
}
}
if(stack.empty())
return true;
return result;
}
}
|
|
|
|
|
I would guess that the two following if statements are not correct, so you are stuck in the while loop.
if((!stack.empty())&&(s.charAt(i)==')'||s.charAt(i)=='}'||s.charAt(i)==']')){
if(stack.peek()==s.charAt(i)){
So if you have just encountered an open bracket the first of these statements will be false, because i is still pointing to the open bracket in your string. The loop will just continue round examining the same character.
|
|
|
|
|
Hi,
1. what Richard said.
2. Your code is far from correct, there is no reason whatsoever to look more than once at the same character, so index i should get incremented unconditionally, hence a for-loop or better yet a foreach-loop would be preferable.
3. You shouldn't be calling CharAt() over and over, do it once and store the result in currentCharacter
4. What closes a "{" isn't another "{", it is a "}"; an easy way to get this, is by having separate test-and-push combinations (if it is "{" then push "}").
|
|
|
|
|
Elenora wrote: stack.push(s.charAt(i));
Only way that code can run out of memory is if that line is called way to many times.
|
|
|
|