PROGRAMMING an der Sheridan College | Karteikarten & Zusammenfassungen

Lernmaterialien für PROGRAMMING an der Sheridan College

Greife auf kostenlose Karteikarten, Zusammenfassungen, Übungsaufgaben und Altklausuren für deinen PROGRAMMING Kurs an der Sheridan College zu.

TESTE DEIN WISSEN

Which are the ways that you can declare a variable

Lösung anzeigen
TESTE DEIN WISSEN

double _radious;

Lösung ausblenden
TESTE DEIN WISSEN
How many times does the body in a do-while loop execute?
Lösung anzeigen
TESTE DEIN WISSEN
1 or more times
Lösung ausblenden
TESTE DEIN WISSEN

What is the difference between these to blocks of code:


1.

if (number % 2 == 0) 

          even = true;

else 

           even = false;


2.

boolean even = number % 2 == 0;




Lösung anzeigen
TESTE DEIN WISSEN

Nothing, they mean the same thing

Lösung ausblenden
TESTE DEIN WISSEN

Methods require parameters

Lösung anzeigen
TESTE DEIN WISSEN

NO, but they still need parentheses.

Lösung ausblenden
TESTE DEIN WISSEN

CONVERSION RULES:


To assign a double variable to an int variable x, you write;



Lösung anzeigen
TESTE DEIN WISSEN

x = (int)d;

Lösung ausblenden
TESTE DEIN WISSEN

In a method, what is the process to use parameters?

Lösung anzeigen
TESTE DEIN WISSEN
  1. Caller supplies values to the declared arguments
  2. Runtime puts the value inside the parameter variable
    1. Analogy:
      1. Imagine a produce person (the caller during runtime) providing a certain amount of a produce (e.g. tomatoes, potatoes.etc) to a chef (the method) to make a recipe.
Lösung ausblenden
TESTE DEIN WISSEN

What does the ternary operator do? How is it used?

Lösung anzeigen
TESTE DEIN WISSEN

The ternary operator evaluates a boolean (true or false) expression and returns a value depending on if the expression is true or not.


[expression to be evaluated] ? [return value if true] : [return value if false];

Lösung ausblenden
TESTE DEIN WISSEN

What is a return statement in Java?  Why would "void" not be the indicated return type for returning variables to the main class?

Lösung anzeigen
TESTE DEIN WISSEN
  • Return statements allow you to manipulate the parameters passed in the method, like storing the result of the executed code on the method into a variable in the main class.  
  • Void means that the method does not store any values in it and it simply runs the block of code when called in the class
Lösung ausblenden
TESTE DEIN WISSEN

How can we determine which parts of a program can call a method?

Lösung anzeigen
TESTE DEIN WISSEN

The visibility will determine which part of the programs can call a method:

  • Public 
  • Private
Lösung ausblenden
TESTE DEIN WISSEN

ACCESSOR METHODS:


1. The purpose of an accessor method is to: 

2. They have parameters

3. They begin with the prefix a) ______ and b)_____ the field name

4. They are also called

Lösung anzeigen
TESTE DEIN WISSEN
  1. Return the value of a field variable, they are the means by which the values of instance fields can be brought outside of the class. An accessor will have access to the values stored in a private class.
  2. No
  3. a) "get", b) Capitalized
  4. Getters, get method


Lösung ausblenden
TESTE DEIN WISSEN

Reading Input:

  1. System: Provides general a)_____ like access to b)____ 
  2. ImputStream: allows programs to a)____ from a variety of sources
  3. Scanner: allows programs to a) ___
Lösung anzeigen
TESTE DEIN WISSEN
  1. System: a) Functionality, b) standard input and output, time, program properties etc.
  2. ImputStream: a) read input
  3. Scanner: a) input AND OBTAIN information

 

Lösung ausblenden
TESTE DEIN WISSEN

What is a constructor? How can you make a constructor?

Lösung anzeigen
TESTE DEIN WISSEN
  • Method that initializes instance fields (a variable that is bounded to the object itself, it is not static, it is subject to change)
  • It has the same name as the class and they have no return type
  • Syntax for creation of a constructor: 
    • public <Name of Method> {
    • <field initialization>
    • }



Lösung ausblenden
  • 49 Karteikarten
  • 36 Studierende
  • 0 Lernmaterialien

Beispielhafte Karteikarten für deinen PROGRAMMING Kurs an der Sheridan College - von Kommilitonen auf StudySmarter erstellt!

Q:

Which are the ways that you can declare a variable

A:

double _radious;

Q:
How many times does the body in a do-while loop execute?
A:
1 or more times
Q:

What is the difference between these to blocks of code:


1.

if (number % 2 == 0) 

          even = true;

else 

           even = false;


2.

boolean even = number % 2 == 0;




A:

Nothing, they mean the same thing

Q:

Methods require parameters

A:

NO, but they still need parentheses.

Q:

CONVERSION RULES:


To assign a double variable to an int variable x, you write;



A:

x = (int)d;

Mehr Karteikarten anzeigen
Q:

In a method, what is the process to use parameters?

A:
  1. Caller supplies values to the declared arguments
  2. Runtime puts the value inside the parameter variable
    1. Analogy:
      1. Imagine a produce person (the caller during runtime) providing a certain amount of a produce (e.g. tomatoes, potatoes.etc) to a chef (the method) to make a recipe.
Q:

What does the ternary operator do? How is it used?

A:

The ternary operator evaluates a boolean (true or false) expression and returns a value depending on if the expression is true or not.


[expression to be evaluated] ? [return value if true] : [return value if false];

Q:

What is a return statement in Java?  Why would "void" not be the indicated return type for returning variables to the main class?

A:
  • Return statements allow you to manipulate the parameters passed in the method, like storing the result of the executed code on the method into a variable in the main class.  
  • Void means that the method does not store any values in it and it simply runs the block of code when called in the class
Q:

How can we determine which parts of a program can call a method?

A:

The visibility will determine which part of the programs can call a method:

  • Public 
  • Private
Q:

ACCESSOR METHODS:


1. The purpose of an accessor method is to: 

2. They have parameters

3. They begin with the prefix a) ______ and b)_____ the field name

4. They are also called

A:
  1. Return the value of a field variable, they are the means by which the values of instance fields can be brought outside of the class. An accessor will have access to the values stored in a private class.
  2. No
  3. a) "get", b) Capitalized
  4. Getters, get method


Q:

Reading Input:

  1. System: Provides general a)_____ like access to b)____ 
  2. ImputStream: allows programs to a)____ from a variety of sources
  3. Scanner: allows programs to a) ___
A:
  1. System: a) Functionality, b) standard input and output, time, program properties etc.
  2. ImputStream: a) read input
  3. Scanner: a) input AND OBTAIN information

 

Q:

What is a constructor? How can you make a constructor?

A:
  • Method that initializes instance fields (a variable that is bounded to the object itself, it is not static, it is subject to change)
  • It has the same name as the class and they have no return type
  • Syntax for creation of a constructor: 
    • public <Name of Method> {
    • <field initialization>
    • }



PROGRAMMING

Erstelle und finde Lernmaterialien auf StudySmarter.

Greife kostenlos auf tausende geteilte Karteikarten, Zusammenfassungen, Altklausuren und mehr zu.

Jetzt loslegen

Das sind die beliebtesten PROGRAMMING Kurse im gesamten StudySmarter Universum

Programmierung

Berufsakademie Sachsen - Staatliche Studienakademie Dresden

Zum Kurs

Die all-in-one Lernapp für Studierende

Greife auf Millionen geteilter Lernmaterialien der StudySmarter Community zu
Kostenlos anmelden PROGRAMMING
Erstelle Karteikarten und Zusammenfassungen mit den StudySmarter Tools
Kostenlos loslegen PROGRAMMING