Java for Beginners 7 - Primitive Types: Declaration Solution
Lecture 7: Primitive Types: Declaration Solution
Primitive type declaration coding exercise
Declare a char data type, named letterYPrimitive Types coding solution
char letterY;
Hi there, I am Marius from AlefTav Coding. In this lecture you will learn the solution to the declaration coding exercise.
The coding exercise required you to Declare a char data type, named letterY. In the solution above you see that we need to use the Java declaration pattern dataType storageName
Firstly, you declare a char data type. The next part of the declaration pattern is the storage name. Here we are asked to give the name of the storage area, letterY. To complete the Java statement you add a semi-colon (;).
public class Lecture7 {
public static void main(String[] args) {
// TODO: Declare a char data type, named letterY
}
}
We have here a class, Lecture7 with a main() method. I replace the TODO comment with the solution, char letterY;. This is the answer to the coding exercise.
In the next lecture you will learn to initialize a primitive data type.
This is Marius from AlefTav Coding. Till next time, KEEP CODING.
Please upvote, re-steem and share. For more of this you can find me at the following links.
https://busy.org/@mariusclaassen
https://steemit.com/@mariusclaassen
https://d.tube/#!/c/mariusclaassen
https://www.udemy.com/java-8-for-complete-beginners/learn/v4/overview