0

While I am most fluent in Python, I've recently started learning Java. I was wondering if there is a similar function in Java to Python's def function. Something that allows me to write some code and store it within a callable function is what I am looking for.

0

1 Answer 1

1

No, java Dosen't have any def keyword for declaring functions, instead it has declaring methods inside classes like:

public static void myMethod(string[] args){
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.