what is the name of the java compiler: java.c
.java and javac questions that will be asked on the midterm
what is the extention that is used for all c# clacess .cs and what is the name of the c# compiler: csc
if you wanted to , and watned to live you likfe you could compite and edit with compler, yo umay have a .csc file, with my file.cs to run you would need to do Myfile.exe, no need for java, does not need a program like java to run it. Java has a virtual machine, what happens when you created a .class file, you have this virtual machine btween java and the machine. when you type myfle.exe you go from this to the intermediate language and then to the virtual machine. similar to java. the import statement in java, means I’m using a library and inside that library i have access to all the clacess
can you write java programs without import statement? yes you can, import statemnt are convenient, they alow you to write a short name instead of a long name instead of havign to write the import writter every time you are going to use it, you call impport writter and you run iit with system.out.pritnln its a short hand, or rather
the import statemnt allows a shrothand for the names. when you import you are importing class files from that packages.
where is the package java.io located?
its in a foldier somewere in java.io you might not know where that is, but they are in a foldier named java.io, a package in java is a foldier, they use the dot instead of the / because the / is not consistent in all os.
java is meant to run everywere. so where is this package located? its acually located in a foldeire depending on your system, depending on your java IO. its a coresponcace, btween the name of the fil,e the loation and teh corespondance. .net is not like this, it does have a similar import wish is confusing, they are using the using statement, wish is anonying cus using has multiple meanings in .net, they overuse using, using means alot of thing snad we’ll get into it latter, its as if using with import means something completely differntce, the other use of using… is a carryover of the old c++ and this new one, is actually knind of equivalent oof th eold program in the sequel. they could have used include but include has a differnt meaning also,
there is no relationship between the using statemnt and a path ont he file system. in .net it is not as restricted, there is no correlation between ssytem , there is no foldier where it has to be, very loose.
no relationship with the file systme, it is tied to a namespace statment, using stateming is tied to the namespae i used ot avo=mbiguity name fo one assembly to another.
No relationship tween names, totally flexible, too flexible for me.
what is a namespace, awnser is , something you can use to avoid ambiguity, when you ahve a name comclict in .net and you want to fix it, just put them in a differnt namespace, just in the file put them under a differnt namespace.
Class Myfirst hello
if you only wanted to use it once, you can write Ssytem.concole.WriteLine….
same as java. too close to java.
namespace cop4226 // everything ni here is called cop …
Static void main ()
static void Main ()
namespace ch1, class another namespace… namespaces
these are example of namespace creations, how do you refernce this things. from here you refernce via the . ssytem, similar to java, without the namespace you cant find hello, you cant just do Main() but you have to do anothernamespace.hello. namespaces make things very troublesome and hard to understand so dont overuse them in your code.
- Namespace for forms there are many clacess in the namespace, one of then is MessageBox . and can you guess what it does… you can overwrite and change them as you will. its......
- Access modifiers in C# Public means public, Protected means… protected now protected is different in java. package is teh default, while protected … has more restricted access. anything that extends from this class has......