473,382 Members | 1,421 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,382 software developers and data experts.

Need help with the basics..from a newbie

3
Hi,
I'm real new to Java and need some help...was going through some old tutorials and need help with these questions:
1)What is “composition of methods?” How do u define the composition of methods?

2)What is the difference between the output from
String s;
System.out.println(“s = “+s);
and
String s = new String();
System.out.println(“s = “+s);

The value in string in the first code will retain its original value while the 2nd would get its string s value from the "new string" variable. Is this right?

3)What is the difference between equality of objects and equality of the references that refer to them?

4)What are the two parts required of every recursive method?
The counter(is this correct?)...and??

5)What does int[8] represent?
int refers to the data type of 8,being an integer and 8 being the value passed down(parameter). Is this correct?

6)What’s wrong with this:
char[] name=”Boris Yeltsin”;
Boris Yeltsin should be declared as a string type..without the " ". Is this right? Should the [] be there? There are no arguments being passed down.

Would appreciate your time.
Thanks

-Newbie
Mar 10 '07 #1
3 2145
r035198x
13,262 8TB
Hi,
I'm real new to Java and need some help...was going through some old tutorials and need help with these questions:
1)What is “composition of methods?” How do u define the composition of methods?

2)What is the difference between the output from
String s;
System.out.println(“s = “+s);
and
String s = new String();
System.out.println(“s = “+s);

The value in string in the first code will retain its original value while the 2nd would get its string s value from the "new string" variable. Is this right?

3)What is the difference between equality of objects and equality of the references that refer to them?

4)What are the two parts required of every recursive method?
The counter(is this correct?)...and??

5)What does int[8] represent?
int refers to the data type of 8,being an integer and 8 being the value passed down(parameter). Is this correct?

6)What’s wrong with this:
char[] name=”Boris Yeltsin”;
Boris Yeltsin should be declared as a string type..without the " ". Is this right? Should the [] be there? There are no arguments being passed down.

Would appreciate your time.
Thanks

-Newbie
Post also what you think are the solutions to these questions.

You can also read here for some ideas. We can only give you solutions when you have tried on your own and are convinced you cannot get them correct.
Mar 10 '07 #2
R69D
3
Post also what you think are the solutions to these questions.

You can also read here for some ideas. We can only give you solutions when you have tried on your own and are convinced you cannot get them correct.
Hi there,
I have written the solutions there...or what I think. I need someone to correct me as I myself am not sure if I am correct or not and need some guidance.
However..I really don't have a clue abt a couple questions....
Mar 10 '07 #3
r035198x
13,262 8TB
Hi there,
I have written the solutions there...or what I think. I need someone to correct me as I myself am not sure if I am correct or not and need some guidance.
However..I really don't have a clue abt a couple questions....
Ok. Where did you get number 1? It doesn't sound right

Composition specifies a “has-a” relationship between classes(not methods) where one class has a data member that is an instance of the other class, such as “a car has a tire”. When creating a program, you need to choose whether to relate classes through inheritance or composition.

Here is an article about it.
Mar 10 '07 #4

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

Similar topics

0
by: marcello stanley | last post by:
--Boundary_(ID_89yLhNmAybJBOhP/kmhVvw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Hello, I am a mySQL newbie here and have some problem defining the mySQL...
5
by: Newbee Adam | last post by:
I am having some problems with getting squgglie lines under stringbuilder and ConfigurationSettings what am I doing wrong, is this even close to working? help....
8
by: Jason | last post by:
A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
90
by: Jhon smith | last post by:
Hi all,Just wondering are there any problems with learning c from older books,as I have picked up some from 1988,1994,1997,1998. By using books of this age(Im on a tight budget)am I going to...
48
by: Chad Z. Hower aka Kudzu | last post by:
A few of you may recognize me from the recent posts I have made about Indy <http://www.indyproject.org/indy.html> Those of you coming to .net from the Delphi world know truly how unique and...
17
by: Mark | last post by:
I must create a routine that finds tokens in small, arbitrary VB code snippets. For example, it might have to find all occurrences of {Formula} I was thinking that using regular expressions...
2
by: sr046176 | last post by:
Hi, I'm new to html and to posting threads on forums so please be patient with me. I'm working on my wedding web page using a free template through Wedding Channel. The template allows you to change...
2
by: notAclueabouthtml | last post by:
Hi all, Well, I think that I have bit off more than I can chew. I believe that I would benefit from a private tutor of sorts. but here goes. I am in charge of my kids middle school "giving fund"....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?

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.