GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Ohne Titel

kclark573 Englisch 59 Karten

Karten in diesem Stapel (59)

  1. 1What is used to compile a Java program?javac
  2. 2What is used to execute a Java program?java
  3. 3What is the extension for a Java source file?.java
  4. 4What is the file extension for a Java file after compiling?.class
  5. 5A java class consists of two things. What are they?1. Variables (Fields)
    2. Methods
  6. 6What are access modifiers?Modifiers that specify the level of access for classes, fields, and methods.
  7. 7There are four types of access modifiers. Name them.1. Default/nonspecified. No access modifier given by programmer.
    2. Private
    3. Public
    4. Protected
  8. 8What does the default access modifier do?Makes something visible to the package.
  9. 9What does the private access modifier do?Makes something visible only to the class.
  10. 10What does the public access modifier do?Makes something visible to the world.
  11. 11What does the protected access modifier do?Makes something visible to the package and all subclasses.
  12. 12What is the scope(visibility) of a protected access modifier?Any class within that same package and any subclass.
  13. 13What is a package in Java?A logical collection of classes.
  14. 14What does the file produced by Java compiler contain?Bytecodes
  15. 15What executes the programs compiled by the compiler?Java Virtual Machine (JVM)
  16. 16Bytecodes are platform independent or dependent?Independent
  17. 17How do objects communicate with one another?Through methods.
  18. 18What is information hiding?Declaring public methods and private fields(variables)
  19. 19What is a class?A reusable software component.
  20. 20How is an object of a class created?Through instantiation
  21. 21In instantiation, what method is called implicitly?Constructor
  22. 22What is the difference between an instance and a class variable?Class variable is shared by all instances; instance variable is not shared.
  23. 23Static variables are initialized....Only once at the beginning of execution, and before any of the instance variables are initialized.
  24. 24If a static variable is also declared as final...It can not be changed by any of the instances.
  25. 25A static variable can be accessed directly by the...and doesn't need any....Class name, object
  26. 26Give an example of accessing a static variable.ClassName.StaticVariableName
  27. 27What do static methods belong to?They belong to the class and not to individual instances
  28. 28A static method can only access what kind of variables?Static data(variables), but cannot access instanced variables.
  29. 29A static method can call what kinds of methods?A static method can call only other static methods - they cannot call a non-static method.
  30. 30How can a static method be accessed?Using the ClassName and doesn't need any object to be created.
  31. 31A static method cannot use what keyword?"this", which points to the current instance.
  32. 32Can a Static Method access a Static Variable?Yes
  33. 33Can a Static Method access an Instance Variable?No
  34. 34Can a Static Method call a static method?Yes
  35. 35Can a static method call an instance method?No
  36. 36Can an Instance(non-static) method access a static variable?Yes
  37. 37Can an Instance method access an Instance Variable?Yes
  38. 38Can an Instance method call a static method?Yes
  39. 39Can an Instance method call an instance method?Yes
  40. 40Can a static method change an instance variable?No
  41. 41Can an instance method change a static variable?Yes
  42. 42What two things must a parameter of a method specify?Type and Name
  43. 43Java provides what two primitive types for storing floating point numbers in memory?Float and Double
  44. 44What return type indicates that a method will not return a value?void
  45. 45Class String is in which package?java.lang
  46. 46Can the class String be extended?No
  47. 47What is the difference between a local variable and a field?A local variable is declared in the body of a method and can be used only from the point at which it's declared through the end of the method declaration. A field is declared in a class, but not in the body of any of the class's methods. Also, fields are accessible to all methods of the class.
  48. 48What is the default value for an integer (int)?0
  49. 49What is the default value for a String?null
  50. 50What is method overloading?Having several methods with the same name that each operate on different types or number of arguments.
  51. 51What is this an example of? Student5(int i, String n){ } Student5(int i, String n, int a){ }Method Overloading
  52. 52Method hypotenuse, which takes two double-precision, floating-point arguments side1 and side2 and returns a double, floating point result.double hypotenuse(double side1, double side2)
  53. 53Method smallest, which takes three integers x, y, and z, and then returns an integer.int smallest( int x, int y, int z)
  54. 54Method instructions, which does not take any arguments and does not return a value.void instructions()
  55. 55Method intToFloat, which takes integer argument number and returns a float.float intToFloat(int number)
  56. 56What operator is used to allocate memory to array variables in Java?new
  57. 57How do you specify in a method that you will allow a variable length parameters?methodName(type...varName)
  58. 58For strings: = is comparing what?Reference values, or where they are.
  59. 59For strings: .equals() compares what?Values of the strings. (Like Cabbage .equals("Cabbage"), but Cabbage (doesn't equal) .equals("MyCabbages!")

Informationen

Beschreibung
Karteikarten am Ohne Titel, erstellt von kclark573 am 06/05/2015.
Erstellt von
kclark573
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck