Win a copy of Rust Web Development this week in the Other Languages forum!

Stephen Silva

Greenhorn
+ Follow
since Jul 12, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephen Silva

Thanks a lot for the reply.
I also think those data structures will be useful in doing this question.
Can somebody please help me in this problem. I want to know the best data structure that I can use to accomplish this task and the way that it can be implemented.

Problem:
E-books are becoming more and more popular due to various reasons. In this project, you are required to create and maintain a keyword index for an e-book. The keywords are extracted from the book and are made available to you in the following format.

Keyword1 1
Keyword2 1
Keyword3 1
Keyword4 1
Keyword5 1
Keyword1 2
Keyword6 2
Keyword7 3
Keyword1 3
Keyword2 3

In the above list, each line contains a string and a number separated by a “tab” character. The string is the keyword and the number represents a page number the keyword appeared. You are expected to read the input file and store the keywords and the pages they appear. The system should provide the following functionality.

1. Given a keyword, output the first page the keyword appeared.
2. Given a keyword, output the sorted list of pages (in ascending order) a given keyword appeared.
3. Given a page number, output the sorted list of keywords (in ascending order) that appeared in the page.

Thank you.
Thanks a lot for the reply
Sorry, I don't know about that post.
But I am in need of having an idea about aliasing to answer this question.

I know it's your valuable time that you spend to answer these questions.
I always respect that.

Thanks.
thanks

Need to know what the aliasing is in this programme and What does that really expect to do?
Thanks a lot for the answers.

But I need a simple application which shows the usage of the static modifier.
If you have any sample codes, but simple ones can you help me in this regard.

Thanks.
Thanks for the reply.

It compiles with slight modifications to the code.
class Letter{
char c;
}

public class PassObject {

static void f(Letter y){
y.c='z';
}

public static void main(String[] args) {
Letter x=new Letter();
x.c='a';
System.out.println("1: x.c "+x.c);
f(x);
System.out.println("2: x.c "+x.c);
}

But I want to know how to address the issue aliasing in this programme
Aliasing also can happen within method calls, the following program illustrates it. Identify
the problem and modify the program to address the aliasing.

class Letter {
char c;
}
public class PassObject {
static void f(Letter y) {
y.c = z;
}
public static void main(String[] args) {
Letter x = new Letter();
x.c = a;
print("1: x.c: " + x.c);
f(x);
print("2: x.c: " + x.c);
}
}

Can somebody please, explain me what is aliasing and solution to this problem.

Thanks.
Write an application where the static modifier becomes useful.

Can some one please, give me a good example to this assignment.


I have written a code to explain the consequences of static modifier.
But I need an application of that.
Thanks.
Thanks a lot.
I got my work done.
10 years ago
I want to activate my addition button in my calculator just after the "+" key of the key board is pressed.
Please let me know the way to achieve this.

Thanks.
10 years ago
Thanks a lot.
I find it very useful.

Thanks.
I am preparing for OCPJP 6 exam these days.
I want to know how can we have past exam questions and/or practice exam questions for OCPJP 6 exam.

Thanks.
Thanks again.

I will join that
10 years ago
Thanks a lot for your posts.
I find it very attractive using The Guidebook-Tutorials.
I follow Oracle tutorials too.
Yes, I agree with you Maneesh. I'm using Notepad++ and command line for my coding and compiling.
I'm using Kathy Sierra's book for my studies.
But the questions there in the book are not enough. I'm trying to find some more past exam questions.
If you can help me in this regard, it'll be a great help for me too.

Thanks.
10 years ago