Sunday 24 June 2012

Algorithm2 & Java

  1. What is the value of X & Y if
    1. R = 400, T = 10 : X = 1400 and Y = 910
    2. R = 4000, T = 20: X = 5000 and Y = 920
               c.  R = 4010, T = 50: X = 0 and Y = 0   


2. How many packages may a Java project contain? 
          Many 

 3. How many classes may a Java package contain? 
          Many  

 4. What are the two types of methods? 

          The 2 types of methods are :
            Procedures and Functions

5. Explain the differences and similarities between the two types of methods. 

Both Process one returns something the other doesnt. 


6. Of the two types of methods, which one is the Main method?   
  Procedure

7.What does the keyword void mean & where is it generally seen?
 Void means nothing meaning nothing is there. Empty is an example of Void it is seen in the main method.  
 
8. What is the special purpose of the Main method?


 It is the starting point of the Java project.  

9. Explain the purpose of a method parameter?

 is a value that supports the main methods function. 

 10.How is the semi-colon used in the Java syntax?
the semi clolon is used to end a piece of code  line so you can start a new one


11. How are the curly braces used in the Java syntax?
Curly Braces are used to end a certin amount of code example you adding a  pice of code thats all related and you wanted to start something new ater it you would have to use curly braces to mange everything.  

12.What data type stores whole numbers?  

 Primitive Data TYPE

13.What data type stores a collection of keyboard characters?

String

14.What data type stores a single character
Char 

15 .What data type stores a True/False value? 
Boolean

16. What is a variable used for?
To hold Values together. 

  1. What is the syntax for a literal string?

 Double Quotation Marks

18. What is the syntax for a literal character?

Single Quote Characters 
  
19. What is the syntax for a literal whole number?
  Whole Number Are Followed By The "L" 

20.  What is the increment operator?  
     +

21. What is the decrement operator? 
 +
 
22. What is the concatenation operator? 
 +

23. What keyword is used between each case in a Switch, to stop execution of the Switch? 
 "Else"
 
24. What should always be the last case of a Switch?
"End Else"
 
 25. How is an object defined? 
 By Its State And Behavior


26. What is the difference between an object and a class? Use a real world object on your example if you like.

A Class Is A Full Definition Of All State And Behavior 












No comments:

Post a Comment