Sponsored Content
Full Discussion: Constructor problem
Top Forums UNIX for Dummies Questions & Answers Constructor problem Post 302087777 by aniseed on Tuesday 5th of September 2006 05:46:15 PM
Old 09-05-2006
Quote:
Originally Posted by woot4moo
Hi guys I am new to these forums but since I am taking a class at college I would appreciate any help that is possible for this program. My instructor said that when its complete the program should be able to store all 3 fields instead of just 1.

public class Greeter2Test
{
public static void main( String[] args)
{
Greeter terse = new Greeter ( "Hello, ", "Goodbye, ", "Dave" );
Greeter verbose = new Greeter ("How are you, ", "Have a nice day, ", "Hal");

System.out.println( terse.sayHello() );
System.out.println( verbose.sayHello() );
System.out.println( verbose.sayGoodbye() );
System.out.println( terse.sayGoodbye() );
}
}
Im not sure what it is that I am supposed to edit to make it work properly
The error I get is cannot find symbol. But I cant see which symbol it means or what exactly it is that I am misssing any help would be most appreciated.
I'm not sure what you mean - or what your instructor means. I don't see any place where it is taking a single input. And I don't know what he means by making it take three. You might post what that Greeter class contains.

How, may I also ask, is it related to Unix? Smilie
 

7 More Discussions You Might Find Interesting

1. Programming

why constructor cannot be virtual

helo i read many books but i cant find the proper answer that why constructor cannot be virtual can u explain me in simple term that why constructor cannot be virtual Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

2. Programming

how do you handle a constructor and destructor that fail

helo i m new in c++ on linux can u tell me with an simple example that how do you handle constructor and destructor that fail? Regards, Amit (4 Replies)
Discussion started by: amitpansuria
4 Replies

3. Shell Programming and Scripting

call constructor of java class in script

Hi, Is it possible to call the constructur of a java class in a shell script? I know you can call static methods, but can you also call the constructor? tnx. (1 Reply)
Discussion started by: thebladerunner
1 Replies

4. Programming

Doubt regarding Copy Constructor and return value

Hi All, I have made the simple following program :- #include <string> #include <iostream> using namespace std; class A{ private: int val; public : A(){cout<<"In A()"<<endl;} A (const A& aa) { cout<<"In copy c'tor"<<endl; } }; A f(... (1 Reply)
Discussion started by: shubhranshu
1 Replies

5. Programming

c++ object constructor question

I have the following code class Param{ public: Param(int aa, int bb){ a=aa; b=bb; } int a,b; }; void function(Param); int main(){ function(2,3); return 0; } (6 Replies)
Discussion started by: santiagorf
6 Replies

6. Programming

Doubts on C++ copy constructor concept

Hi, If I run the following program class A { public: A() { cout << "default" << endl; } A(const A&) { cout << "copy" << endl; } }; A tmp; A fun() { return tmp; } A test() { A tmp; cout << &tmp << endl; return tmp; } (1 Reply)
Discussion started by: royalibrahim
1 Replies

7. Programming

Constructor?

I am learning about C++ and today am reading concepts for Constructor but it seems a bit difficult to grab it fully. Please anyone explain in simple words about Constructor? (1 Reply)
Discussion started by: ggiwebsinfo
1 Replies
BHOST(5)							 LAM FILE FORMATS							  BHOST(5)

NAME
bhost - LAM boot schema (host file) format SYNTAX
# # comments # <machine> [cpu=<cpucount>] [user=<userid>] <machine> [cpu=<cpucount>] [user=<userid>] ... DESCRIPTION
A boot schema describes the machines that will combine to form a multicomputer running LAM. It is used by recon(1) to verify initial con- ditions for running LAM, by lamboot(1) to start LAM, and by lamhalt(1) to terminate LAM (note that wipe(1) has been deprecated by the lamhalt(1) command). The particular syntax of a LAM boot schema is sometimes called the "host file" syntax. It is line oriented. One line indicates the name of a machine, typically the full Internet domain name, an optional number of CPUs available on that machine, and optionally the userid with which to access it. Common boot schema for a particular site may be created by the system administrator and placed in the installation directory under etc/. They typically start with the prefix bhost. Individual users usually create their own boot schema, especially if the configurations are simple. EXAMPLE
Here is an example three node boot schema: # # example LAM host file # beowulf1.nd.edu cpu=2 beowulf2.nd.edu beowulf2.nd.edu somewhere.else.college.edu user=guest Note that the "guest" ID is significant, since the user has an alternate login ID on somewhere.else.college.edu. Additionally note that beowulf1 has a CPU count of 2 listed (a CPU count of 1 is assumed if it is not given). This value is used by mpirun(1), MPI_Comm_spawn(2), and MPI_Comm_spawn_multiple(2) for the "C" (or CPU) notation that specifies how many ranks to start. This is particularly useful for run- ning on SMP machines. beowulf2 is listed twice, but has no specific CPU count listed. In this case, LAM will keep a running tally of the total number of CPUs for that host. Hence, LAM will calculate that beowulf2 has two CPUs available for use. Calculating the number of CPUs by counting occu- rances of a hostname is useful in a batch environment where a hostfile may list the same hostname multiple times, indicating that the batch scheduler has allocated multiple CPUs for a single job (e.g., PBS operates this way). For the above-mentioned schema, the command "mpirun C foo" would start five instances of the foo program; two on beowulf1, two on beowulf2, and one on somewhere.else. FILES
$LAMHOME/etc/bhost.def default boot schema file SEE ALSO
lamboot(1), lamhalt(1), mpirun(1), MPI_Comm_spawn(1), MPI_Comm_spawn_multiple(1), recon(1), wipe(1) LAM 6.5.8 November, 2002 BHOST(5)
All times are GMT -4. The time now is 03:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy