₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,215 members, 8,510,694 topics. Date: Friday, 30 October 2026 at 09:07 PM

Toggle theme

Java Programming Language Methods And Object Need Explanation - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Java Programming Language Methods And Object Need Explanation (1152 Views)

1 Reply (Go Down)

Java Programming Language Methods And Object Need Explanation by abdulsalamgande(op): 12:30am On Feb 10, 2018
Can someone help me with explanation on Methods and object in java programming?
Re: Java Programming Language Methods And Object Need Explanation by kingvicky(m): 11:18am On Feb 10, 2018
abdulsalamgande:
Can someone help me with explanation on Methods and object in java programming?
Methods are subprograms or functions that run a separate bit of code. In Java, methods are usually contained in classes and they can be called using the object of the class in which they are contained or directly in the main method if they are declared as 'static'.. As example - say we have a class named program...

public class Program {

//This is a method
public void printToConsole() {

System.out.println("Hello world"wink;

} //End the method

//This is the main method
public static void main(String[] args) {

//Now we create an object from which we can call
// the method
Program p=new Program();

// Call the method with the created object

p.printToConsole();

} //End main method
} //End class
Re: Java Programming Language Methods And Object Need Explanation by Desyner: 11:39am On Feb 10, 2018
kingvicky:
Methods are subprograms or functions that run a separate bit of code. In Java, methods are usually contained in classes and they can be called using the object of the class in which they are contained or directly in the main method if they are declared as 'static'.. As example - say we have a class named program...

public class Program {

//This is a method
public void printToConsole() {

System.out.println("Hello world"wink;

} //End the method

//This is the main method
public static void main(String[] args) {

//Now we create an object from which we can call
// the method
Program p=new Program();

// Call the method with the created object

p.printToConsole();

} //End main method
} //End class
Correct!
Re: Java Programming Language Methods And Object Need Explanation by talk2hb1(m): 12:25pm On Feb 10, 2018
abdulsalamgande:
Can someone help me with explanation on Methods and object in java programming?
What Part are you not understanding?
Re: Java Programming Language Methods And Object Need Explanation by kingvicky(m): 2:01pm On Feb 10, 2018
Desyner:
Correct!
Thank you bro!
1 Reply

What Are The Limitations Of Flutter Over Kotlin, Swift And Object C • I Need Explanation On This Code?? Php Programmers • Please I Need Explanation Of This Express.js Code • 2 • 3 • 4

Is It Possible To Learn Both Web Design And Programming At The Same Time ? • Christian Nwamba, A Nigerian Software Engineer Becomes Microsoft Developer Advo • Give Me App Ideas