|
Re: Can one not learn Java without knowing C? And C without machine or assembly languages? [message #1768195 is a reply to message #1768148] |
Fri, 14 July 2017 09:50   |
Eclipse User |
|
|
|
It's been a while since my intro to computer engineering course however you are right in your logic. I'm sure someone can correct me when I get fuzzy.
An array is simply an allocated space in memory dedicated to your desired memory type, in this case a string. A string is an array of characters. A character on a 64 bit processor is represented in memory as a series of bytes? A byte is a series of zero's and ones that define the value of a character according to a format known as encoding. Zero's and ones make up the binary logic on which all computations are based. A transistor can only be in two states, on or off. The processor I believe is a large number of really small transistors that alternate between the on and off state which allows binary computation. This is known as machine code. An executable is simply a binary file that contains a large number of zero's and one's that is executed to reproduce a desired computer state.
If you want to start from the beginning, Computer Science degrees start with Introduction to Logic, which goes through binary logic. They usually couple that with an introductory programming course that starts you with "Hello World" applications and you will be off to the races.
To understand the concept of the above line. You have to understand the concept of the black box. The black box takes input in, performs some kind of logic, and returns an output.
Java MyApp arg1 arg2 simply means you have a Java program called MyApp that takes two arguments. An argument is a fancy word for input. In this case the two inputs are strings.
An example of a string is "String"
So the App could perform a table lookup, dictionary lookup based on the string input and return the associated index of that string, for example. But MyApp could do virtually anything you want. The purpose of MyApp is abstracted out, all you know is it takes two inputs arg1 and arg2, until you start playing with the App.
[Updated on: Fri, 14 July 2017 10:07] by Moderator
|
|
|
|
|
Re: Can one not learn Java without knowing C? And C without machine or assembly languages? [message #1768212 is a reply to message #1768203] |
Fri, 14 July 2017 13:34  |
Eclipse User |
|
|
|
Christopher Hoffman wrote on Fri, 14 July 2017 10:22You're right it's not that clear. This is what happens when really smart people try to write tutorials.
A simple explanation is the input to MyApp takes an Array of Strings. The first index of the Array contains arg1, the second index of the array contains arg2. So the call could be MyApp(ArrayofStrings)
Since ArrayofStrings is an array of strings, the input is resolved into arg1 and arg2 ...
But also look at this portion:
Quote:The main method accepts a single argument: an array of elements of type String.
public static void main(String[] args)
My question is: If the main method accepts only a single argument, how come it is an array of elements of the type string. There should only be one array of type String, an array having many character elements. So the statement should have been:
Amended Portion of that Note:The main method accepts a single argument: an array of elementscharacters of typeforming a String.
public static void main(String[] args)
Don't worry, I got your point! It is possible in C, I know. So, it must also logically be possible in Java!
I was just trying to show how the writer made a mess of a simple point.
I thank you!
P.S. Please see for yourself how the CodeRanch forum has made a mess of this simple query I placed before them!
I also need an advice on this thread: A desired book as described herein
Regards
[Updated on: Fri, 14 July 2017 15:07] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.08249 seconds