oop - Is it necessary to create a Java class everytime? -


i starting learn java programming language , little confused.

i create simple program adding 2 numbers or calculate sum of n numbers. can in c or python easily, in java, have create class program , create main class , call program it.

i use both netbeans , intellij.

can create program directly way in other languages? mean concept of class necessary in java?

can create program directly way in other languages?

no.

i mean concept of class necessary in java?

yes. every method, field etc in class (or interface). yes, that's overhead tiny programs - larger programs, impact pretty tiny.

as ever, use right tool job - if want script of few lines, use scripting language. if want more structure , organization, should expect bit of "ceremony" go that.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -