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?
//
3 1034
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.
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..... -
make the fields private
-
initialize them in the constructor
-
do not provide setters methods
-
//u can declare class as final to prevent subclassing(it can defeat base class immutability)
-
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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)
|
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...
|
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)....
|
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...
|
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...
|
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...
|
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
{
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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,...
|
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...
|
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...
| |