“Good to see you” Introductory object based modular program – Computer Sir Ki Class
  

Login
[lwa]



Code Learning #JAVA#3791    siteicon   siteicon  

“Good to see you” Introductory object based modular program

An introductory program to show object based procedure call capability of Java Program.

Learning Objectives

  • A sample to show how java programming is different and is class object and method call based.

Source Code

TC++ #3791

Source Code

Code Understanding

class Intro
{
void display()
{
System.out.println(“Good to see you.”);
}
public static void main(String[] args)
{
Intro ob=new Intro();
ob.display();
}
}

Notes

class Intro
Every program must in a class envelope.
{

void display()
A class contains functional methods or modules
{

System.out.println(“Good to see you.”);
A method called more methods with given arguments.
}
public static void main(String[] args)
A class with main method is called first which is the starting point of program execution process.
{

Intro ob=new Intro(); 
Before any method/module/procedure is used, its place in memory known as object is created.

ob.display();
Method of given object is called.
}
}


Suggested Filename(s): Intro.java



Share

sunmitra| Created: 10-Mar-2018 | Updated: 10-Mar-2018|









Back