It's rather confusing to try to describe the difference between these two. Let's look at an example of each.
A procedure in Java would be a method. It looks something like this:
void f(int n){
System.out.println(n);
}
A block in Java is any bit of code contained within curly braces {}
(Note that all methods must contain at least one block of code.)
// This is still a method.
void f(int n){ // This signifies the start of the method's main block of code
{// This is the start of another (inner) block of code
System.out.print(n);
System.out.println();
}// This closes the previous block
}// This closes the method's main block
The confusing part comes when trying to describe each one. All procedures (methods) in Java must be contained within a block of code - the class block. However, all procedures must also contain at least one block of executable code.
In conclusion: a block may be contained within a procedure and a procedure must be contained within a block.
In C there are functions only, In Java methodsonly (static methods as well), in C++ both.
They are different versions. Java 5 is newer than Java 2. Think of it like the difference between the Playstation 1 and the Playstation 3.
Java is object oriented, C is not...
kamina
kamina
C is a procedure oriented language ,Where C++ & java are object oriented language.But java is platform independent.So generally C is called POP.C++ is called OOP.But java is OOP , which is platform independent.If java does not support primitive data type then it is called as pure object oriented language.
Unix is an operating system, Java is a language.
Rowset
JAD-Java Application Description JAR-Java archive
java is a programming language/platform that embodies object oriented programming concepts. The question of what is the difference is like asking what is the difference between cars and a Volvo.
Java doesn't have pointers. C++ has pointers.
Both are same