-7

I'm trying to write two examples of code in java: OOP and procedural, but I can't think of procedural code example. I have one example of an OOP code below. Can someone give me an example of a procedural code and explain a little as to what it does?

OOP example below:

Class test {
 public static void main (String args []){ 
       int test = 6;
       if (test == 9){
            System.out.println(“True”);     
   } else {
           System.out.println(“False”);
      }
} 
Jose Ivan
  • 3
  • 2
  • 4
  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – HDJEMAI Jan 17 '16 at 03:27
  • Interesting enough, the body of your main method is an example of procedural code. – ChiefTwoPencils Jan 17 '16 at 04:04
  • 2
    Possible duplicate of [Practical Explanation : Can anyone Explain the difference between POPS and OOPS with Example?](http://stackoverflow.com/questions/24360230/practical-explanation-can-anyone-explain-the-difference-between-pops-and-oops) – Tom Jan 17 '16 at 04:52

1 Answers1

0

Java is designed to be fully object-oriented while C is a procedural language. I suggest looking at http://www.tutorialspoint.com/cprogramming/c_overview.htm to read about C. Java is not meant to be used for procedural. This is all I can do to help. You need to do some research on the programming paradigms. Practical Explanation : Can anyone Explain the difference between POPS and OOPS with Example?

Community
  • 1
  • 1
CodeManny
  • 43
  • 3