writing a code

writing a code

write a code for a class called display that will display your name and age onto the screen
View Answers

May 11, 2010 at 4:19 PM

Hi Friend,

Try the following code:

class display{
String name;
int age;
public display(String n,int a){
this.name=n;
this.age=a;
}
public String toString() {
return "Name= " + name + ", Age= " +age;
}
public static void main(String[] args){
display d = new display("Angel", 20);
System.out.println(d);
}
}

Thanks









Related Tutorials/Questions & Answers:
writing a code - Java Beginners
writing a code  write a code for a class called display that will display your name and age onto the screen  Hi Friend, Try the following code: class display{ String name; int age; public display(String n,int
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Advertisements
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Writing code with multiple Class Methods and String Arrays
Writing code with multiple Class Methods and String Arrays  So what I am trying to do is create a code that lists music artists names using user... to generate the entire list once prompted. To give a better idea of how the code
Writing code with multiple Class Methods and String Arrays
Writing code with multiple Class Methods and String Arrays  So what I am trying to do is create a code that lists music artists names using user... to generate the entire list once prompted. To give a better idea of how the code
writing characters
writing characters  how to write a group of characters to a string ... i mean for writing single character using charAt in java
Ghost Writing
Ghost Writing Ghost Writing is the kind of writing when someone... of writing it. So ghostwriter is a person who works behind the scene on a writing project in return of certain amount. The write-ups of the writer
Blog Writing
Blog Writing A blog, the short form of web log is an online user... on that. But the professionals are a better choice for writing the blog for commercial or promotional purpose. We provides the services of writing blogs for the commercial
Writing Actions
Writing Actions The Action is responsible for controlling of data flow within an application. You can make any java class as action. But struts have some built in interface and class for making action easily. To make an Action class
dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible
dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible
writing plugin - WebSevices
writing plugin  can anyone help me in writing plugin for internet explorer browser using c++ in .net environment
writing HTML entirely by hand
writing HTML entirely by hand  How comfortable are you with writing HTML entirely by hand
Web Writing
Web Writing       The art of writing for the web is far removed from writing for the print world.... Following is the prime aspect you need to keep in mind while writing for the web
SEO Writing
SEM and SEO Article Writing SEM and SEO article helps your business to grow... the intended traffic through SEM and SEO article writing in addition to other tools... is the demand of SEM and SEO article writing services. A good command over
writing webservices in php
writing webservices in php  How to write a simple web service in PHP
Writing your First WAP Application.
; Writing your First... with the WML code.   ... favourite text editor like Notepad or Wordpad. After writing
writing aprogram - Java Beginners
writing aprogram  Write a program to reverse any string  Hi Friend, Try the following code: import java.util.*; class StringReverse{ public static void main(String[]args){ Scanner input=new Scanner(System.in
Code
Code  code for connecting c lang to database
code
code    how to write this in java
code
code  code for android sample program
code for this is
code for this is  a b c d c b a a b c c b a a b b a a a code
code
code  please provide code for custom tags.by using currdate tag we need to get current date?please give me code
code
code   hi I need help in creating a java code that reminds user on a particular date about their festival. i have no clue of how to do it.. am looking forward to seek help from you
code
the correct code for a program.The output of the program is listed below...: {Block 5} ADDRESS-3: {San Juan} POST CODE:{6745} ENTER CODE (XX TO stop) CODE:{FF1} QUANTITY:{2} CODE:{TR4} QUANTITY:{1} CODE:XX INVOICE FOR YOUR ORDER Harry
code
code to create the RMI client on the local machine: import java.rmi.*; public... : "+e); } } } However, when the preceding code is executed it results... the correct code
code
code  i have four textboxes.whenever i click on up,down,left or down arrows then the cursor move to another textbox based on the key pressed.i want code for this in javascript
code
line of code to print the amount he should be paid as allowance
Writing a trigger for an userdefined datatype
Writing a trigger for an userdefined datatype  i have a user defined... the following columns DATATYPE :ADDRESS VARCHAR2(136) V_CODE VARCHAR2(8) T_CODE VARCHAR2(4) D_CODE VARCHAR2(2) PIN NUMBER(6) PHONE VARCHAR2(11) NOw I ill
code
code  write a program to encrypt and decrypt the cipher text "adfgvx"   Hi Friend, Try the following code:ADS_TO_REPLACE_1 import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import
Writing First Hibernate Code
Writing First Hibernate Code   ... of writing Hibernate application which is developed using the Hibernate 4. In this video tutorial you will learn the latest method of writing Hibernate code
question "writing prog"
question "writing prog"  Hello I want helping for this question, please Write a program that reads some friendsā?? names, stores them in an array, and then prints out on the screen all friends who start by a particular letter
Image writing over URLConnection
Image writing over URLConnection  Hello, I am trying to write... problems trying to write an image I have succeeded in writing to the local HD using.... The problem is that when writing by ImageIO on URL what will the name of the file
File saving and Writing
File saving and Writing   Hello Rose india..... I have a doubt for you plzzz kindly Help me... I have an "Arraylist" which includes some table values... What i want to ask is "I want to create a jsp page which will include
Writing and Reading A File
Writing and Reading A File  Hello, I've been trying to learn writing and reading data from file for our assignment, but just stuck on how to proceed... help. Thanks in advance. Below is example of my code. import
writing program - Java Beginners
writing program  WAP to input Name of Cricketer, Number of matches, total runs scored for 250 players from the user and print data in descending... code: import java.util.*; class ShowData implements Comparable{ String n
writing and appending to a file
writing and appending to a file  My input file includes data from both males and females. My code below replaces a 'male string' with the key and values and writes into an existing file for 'male'. How can I do the same
writing programs - Java Beginners
writing programs  1.write a program to display odd numbers from 1-50. 2.And Write a program to find the facorial of a number  Hi Friend, 1) class OddNumbers{ public static void main (String args
freelance writing jobs
of writing content for web & print media.  To work in a team
ModuleNotFoundError: No module named 'writing_style'
ModuleNotFoundError: No module named 'writing_style'  Hi, My... 'writing_style' How to remove the ModuleNotFoundError: No module named 'writing_style' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'writing_style'
ModuleNotFoundError: No module named 'writing_style'  Hi, My... 'writing_style' How to remove the ModuleNotFoundError: No module named 'writing_style' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'writing_style'
ModuleNotFoundError: No module named 'writing_style'  Hi, My... 'writing_style' How to remove the ModuleNotFoundError: No module named 'writing_style' error? Thanks   Hi, In your python
writing java programs - Java Beginners
writing java programs  How do i write a code to display even numbers from 1 to 50  Hi Friend, Try the following code: class EvenNumbers{ public static void main (String args[]){ String evenNo
Articles Writing,Articles Writing Services,Articles Writing India,Articles Writing & Content Development
Articles Writing and Content Development In web medium, content... be readable by all. As far as writing an article is concerned, then it becomes... and understandable by all in general. Article writing is the driving force of your
Book Writing
Book Writing We have been providing exceptional writing solutions to a diverse range of clients across the world. So if you are proficient in thinking than writing, or if you are just short
Book Writing
Book Writing Book Writing... story told? We know that writing a book is not everyone's cup of tea... partner to give a professional support for your book writing
Jave writing method - Java Beginners
Jave writing method   HI! i'll really apprecite if anyone can help me...! Implement a method named posNeg that accepts 3 integer parameters..., 19 then the method will return 1. Implement a method named order
Writing for the Purpose of Reading
Writing for the Purpose of Reading   ... disoriented. - The advantage of web writing is that a greater number of lists... by users as promotional writing styles and boastful claims which seem
writing angularjs hello world program
writing angularjs hello world program  Hi, I just started to learn the AngularJS framework. I want to learn it fast and looking for easy to learn... World program in AngularJS. Searching for simple example for writing angularjs
Reading and Writing files - Java Beginners
Reading and Writing files  Hello, please help me to Develop a simple Java application that, when run, Welcomes the users and tells them the name... to investigate writing to files a little (can be also done using Properties

Ads