Created
August 29, 2015 14:26
-
-
Save alagalia/da14ef4c2dd1bfa09756 to your computer and use it in GitHub Desktop.
Commite intro again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Source code recreated from a .class file by IntelliJ IDEA | |
// (powered by Fernflower decompiler) | |
// | |
public class Problem3_Print_Your_Hometown { | |
public Problem3_Print_Your_Hometown() { | |
} | |
public static void main(String[] var0) { | |
System.out.println("Hello I am from Javaland!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Problem3_Print_Your_Hometown { | |
public static void main(String[] args) { | |
System.out.println("Hello I am from Javaland!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class problem5__Print_CurrentDate { | |
public static void main(String[] args) { | |
System.out.println(new Date()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class problem6_Sum_Two_Numbers { | |
public static void main(String[] args) { | |
Scanner scaner = new Scanner(System.in); | |
int a = scaner.nextInt(); | |
int b = scaner.nextInt(); | |
int sum = a + b; | |
System.out.println(sum); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Variant 1 | |
Compile java file from console: | |
1. cd SOFTUNI\Java-Basic\Intro-Java-Homework\src | |
2. set path=%path%;C:Program Files\Java\jdk1.8.0_05\bin | |
3. javac problem6_Sum_Two_Numbers.java | |
4. java problem6_Sum_Two_Numbers | |
VARIANT 2 | |
1. Mouse Right button in directory and start Git Bash | |
2. javac problem6_Sum_Two_Numbers.java | |
3. java problem6_Sum_Two_Numbers | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Problem8_SortArrayofStrings { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.println("Enter number for the length of array:"); | |
int n = scanner.nextInt(); | |
String[] words = new String[n]; | |
System.out.printf("Enter %d words:" , n); | |
for (int i = 0; i < n; i++) { | |
words[i]=scanner.next(); | |
} | |
Arrays.sort(words); | |
for (int i = 0; i <n ; i++) { | |
System.out.println(words[i]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment