GoConqr has a new look! Let us know what you think.

Flashcards

Java test 1

Jacob Sipple English 4.0Average rating 4.0 out of 5 (1 rating) 21 cards

Cards in this deck (21)

  1. 1class formatpublic class ClassName {
    }
  2. 2main methodpublic static void main(String[] args) {
    }
    this is needed as it provides a starting point for program(see if lecture says differently)
  3. 3list of primative data typesint, double, String, boolean, char(think that's all we need but also, short, long and float)
  4. 4how to declare constantin class(not a method) public static dataType final VARIABLENAME
  5. 5convert 150 to binary10010110
  6. 6scopepart of a program where a particular variable is valid
  7. 7declare a variabledatatype variableName
  8. 8declare a methodpublic(can be private too but not worrying about now) static(optional technically but should always use for now) dataType(or void if no return) methodName(datatype param1, datatype param2, ...(parameters are optional))
  9. 9for loop and what does each part dofor (int i = 0; i < something; i++) {
    i < something checks to see if should run like f statement, i++ increases i's value every time the for loop is run by one}
  10. 10.indexOf(whatYouAreLookingFor)gives the index value of where what is enclosed in brackets(if not there gives -1)
  11. 11string.substring(index1, index2) & string.substring(index1)creates a new string with index1 up to but not including index2
    i.e. string = hello
    string.substring(2,4) = ll
    string.substring(1) = ello gives everything after and including first index
  12. 12return statementwill give what the method when called will equal
    i.e. method(int x) {
    return x + 5;
    }
    so method(5) = 10
  13. 13how to print to consoleSystem.out.println();
    System.out.print();(if you don't wanna make new line)
  14. 14compound operators (see if she calls things like this or not)*=, -=, /=, etc.
  15. 15access virtuallyssh into remote.eos.ncsu.edu(a few others as well)
  16. 16afsAndrew File System ncsu's file system that contains course files, as well as can hold your files
    course: afs/eos.ncsu.edu/courses/csc116
    mine: afs/unity.ncsu.edu/users/j/jsipple
  17. 17run filejava fileName.java
  18. 18compile filejavac -d bin(so that .class goes into bin) src(as you should be one up so .class goes into correct bin)/fileName.java
  19. 19procedural decompositionuse methods to stop redundancy of code, making problems into smaller "sub" problems
  20. 20parametervalue passed into a function, allows reuse of function giving different outputs based on information provided to the function
  21. 21returnexits method(nothing below runs) and returns a value for the method(i.e. method call now has a value)

Information

Description
Flashcards on Java test 1, created by Jacob Sipple on 23/01/2020.
Created by
Jacob Sipple
Views
46
Rating
Average rating 4.0 out of 5 (1 rating)

Feedback

What is it about?

What do you think of the new look?

How do you like it?