473,394 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Strings in java

Hi all ,i have somedoubt ,
1)how can say one class is an immutable,and what r basic rules that class should follow?
2)linked list problem?
how do find which is single linked list and which circular liked list,and what r the basic rules should strictly find the list?
3)one class A
{
a{}
}
another class B
{b{}
}
another class C
{
c c1=new c();
// [using class C object , HOWcan call the method of cllass A ,class B }
///i do not answer .
//what base those method call on Class C object?
//
Jul 24 '07 #1
3 1034
r035198x
13,262 8TB
Hi all ,i have somedoubt ,
1)how can say one class is an immutable,and what r basic rules that class should follow?
2)linked list problem?
how do find which is single linked list and which circular liked list,and what r the basic rules should strictly find the list?
3)one class A
{
a{}
}
another class B
{b{}
}
another class C
{
c c1=new c();
// [using class C object , HOWcan call the method of cllass A ,class B }
///i do not answer .
//what base those method call on Class C object?
//
1.) Do you know what immutability means then? Just write a class and use Java modifiers to make it impossible to change the variables in that class. Hint : final, and private are handy here
2.) You cannot call a method in class A from class C without an instance of either A or B directly. To call a super class method, the keyword is ...<drums>... super.
Jul 24 '07 #2
madhoriya22
252 100+
Hi all ,i have somedoubt ,
1)how can say one class is an immutable,and what r basic rules that class should follow?
2)linked list problem?
how do find which is single linked list and which circular liked list,and what r the basic rules should strictly find the list?
3)one class A
{
a{}
}
another class B
{b{}
}
another class C
{
c c1=new c();
// [using class C object , HOWcan call the method of cllass A ,class B }
///i do not answer .
//what base those method call on Class C object?
//
You can go the articles section of this site and can find answers to ur questions urself.
articles

By d way we can do this to make a class immutable.....
Expand|Select|Wrap|Line Numbers
  1. make the fields private 
  2. initialize them in the constructor 
  3. do not provide setters methods 
  4. //u can declare class as final to prevent subclassing(it can defeat base class immutability)
  5.  
Jul 24 '07 #3
praveen2gupta
201 100+
Hi all ,i have somedoubt ,
1)how can say one class is an immutable,and what r basic rules that class should follow?
2)linked list problem?
how do find which is single linked list and which circular liked list,and what r the basic rules should strictly find the list?
3)one class A
{
a{}
}
another class B
{b{}
}
another class C
{
c c1=new c();
// [using class C object , HOWcan call the method of cllass A ,class B }
///i do not answer .
//what base those method call on Class C object?
//

Hi

answers for your query.
1. No Comment
2. In simple linked list last liked list will be null. It will not be pointing to the address of any other list. This isssue is related to the Data Structure.
3. For your query you should apply Inheritance in class B and class C. Once you understand the concepts of the inheritance you will get solutionn how to access methods of class B and class A
Jul 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Rob Jones | last post by:
Hi all, Anyone know the details about String immutability ? I understand the need to have imutable strings at compile time. However if at runtime I have say 8000 strings and then I make a new...
17
by: Gordon Airport | last post by:
Has anyone suggested introducing a mutable string type (yes, of course) and distinguishing them from standard strings by the quote type - single or double? As far as I know ' and " are currently...
11
by: Laurent Therond | last post by:
Maybe you have a minute to clarify the following matter... Consider: --- from cStringIO import StringIO def bencode_rec(x, b): t = type(x)
16
by: Paul Prescod | last post by:
I skimmed the tutorial and something alarmed me. "Strings are a powerful data type in Prothon. Unlike many languages, they can be of unlimited size (constrained only by memory size) and can hold...
5
by: Jan Gregor | last post by:
Hello I found that price of += operator on string is too high in jython. For example 5000 such operations took 90 seconds (i generated html copy of table with 1000 rows and 5 columns)....
5
by: Jamie | last post by:
I have a file that was written using Java and the file has unicode strings. What is the best way to deal with these in C? The file definition reads: Data Field Description CHAR File...
5
by: BBands | last post by:
I'd like to see if a string exists, even approximately, in another. For example if "black" exists in "blakbird" or if "beatles" exists in "beatlemania". The application is to look though a long...
1
by: Edward K Ream | last post by:
Hello all. I'm tracking down memory leaks in my app. To do this I wrote a script to show the numbers of each different type of object. But it doesn't show strings! Here is the script: import...
2
by: otorojava | last post by:
The script works but I'm having a problem reading double and boolean import java.io.*; import java.util.StringTokenizer; import javax.swing.JOptionPane; public class FileAddress {
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.