Computer Science, asked by sanngitasingh2636, 4 months ago

1. Write a Java program as per the given details:
class name : Myself
My name:
Father's name:
Postal address:
Contact Number:
The program displays all the details on the output screen.​

Answers

Answered by BrainlyProgrammer
7

This is a very easy Question....Here is an approach

Code:-

class Myself

{

static void main(String s[])

{

String myName="Abcd";

String fathersName="Abcd's father";

String postalAddress="Abcd's postal address";

int contactNum=9876543210;

System.out.println("My name is: "+myName);

System.out.println("My father's name is: "+fathersName);

System.out.println("Postal Address: "+postalAddress);

System.out.println("Contact Num: "+contactNum);

}

}

Variable Description:-

  1. myName:- To store User's name.
  2. fathersName:- To store User's father's name.
  3. postalAddress:- To store User's address.
  4. contactNum:- To store contact number of the user.
Similar questions