First program - JAVA
Hello!
Welcome on almost last blog about basics! We need to understand what is root problem of programming, we need to know how to write a program and then how to make it to looks good. During your programming life you can grow in knowledge how to have good practice and learn it, because it is important. On this blog I will make nice algorithms and make it great, but for those people who's never start to make it happen I decided to make start articles like this.
So in C++ we can make 3 files with Linux extensions for C++. To will be main.cc, object.hh and object.cc. We can start after a while. In C++ we are using many extension like cpp, cxx, cc, C and for headers h, hxx, hpp, hh it depends for which system you want to make program. Linux people often use cc and hh when Windows users prefer cpp and h - but still it depend from company. So it has no matter on this level. Chose best way for you and start dealing with C++.
Application.java
public class Base
{
string name
public Base(string newName)
{ name = newName; }
public void getName ()
{
System.out.println(name+" go on!");
}
}
public class Application
{
public static void main(String[] args)
{ Base baseObject = new Base("Make it great again");
baseObject.getName(); } }
The most important think! You need to change this scripts, use it in different way? Look how the name parameter work. Make something different from this code. Use it to learn how it works.
So we have start point - main function. So we made an object using constructor with parameters. Next we are using function from Base class and function will write on console, so try it!