Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

main-method

Intellij doesn’t show run button

December 18, 2023 by Tarik

Right click on src directory and select option Mark Directory As > Sources Root.

Categories java Tags intellij-idea, java, main-method Leave a comment

Invoking Java main method with parameters from Eclipse

December 11, 2023 by Tarik

This answer is based on Eclipse 3.4, but should work in older versions of Eclipse. When selecting Run As…, go into the run configurations. On the Arguments tab of your Java run configuration, configure the variable ${string_prompt} to appear (you can click variables to get it, or copy that to set it directly). Every time … Read more

Categories java Tags eclipse, java, main-method Leave a comment

Is there a “main” method in Ruby like in C?

May 27, 2023 by Tarik

@Hauleth’s answer is correct: there is no main method or structure in Ruby. I just want to provide a slightly different view here along with some explanation. When you execute ruby somefile.rb, Ruby executes all of the code in somefile.rb. So if you have a very small project and want it to be self-contained in … Read more

Categories ruby Tags main-method, ruby Leave a comment

Should I define a main method in my ruby scripts?

April 30, 2023 by Tarik

I usually use if __FILE__ == $0 x = SweetClass.new(ARGV) x.run # or go, or whatever end So yes, you can. It just depends on what you are doing.

Categories ruby Tags main-method, ruby Leave a comment

Arguments to main in C [duplicate]

February 23, 2023 by Tarik

The signature of main is: int main(int argc, char **argv); argc refers to the number of command line arguments passed in, which includes the actual name of the program, as invoked by the user. argv contains the actual arguments, starting with index 1. Index 0 is the program name. So, if you ran your program … Read more

Categories c Tags c++, command-line-arguments, main-method Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa