Skip to content

Instantly share code, notes, and snippets.

package numbers;
public class First {
public static void main(String[] args) {
System.out.println(3*7*24*60*60);
}
package numbers;
public class Second {
public static void main(String[] args) {
String stroka1="**********",stroka2="!!!!!",stroka3="After 1970 has passed",stroka4=" years";
long a= System.currentTimeMillis()/1000/60/60/24/365;
System.out.print(stroka2);
System.out.print(stroka1+stroka3);
package numbers;
public class Third {
public static void main(String[] args) {
String name="\"Yuliya\" ";
String str="In my name ";
int size=name.length()-3;
package numbers;
public class Fourth {
public static void main(String[] args) {
String mjQuote="I'm failed over and over and over again in my life that is why I succeed!";
int lastNamber=mjQuote.length()-1;
char lastSimvol=mjQuote.charAt(lastNamber);
package numbers;
public class Fifth {
public static void main(String[] args) {
String mjQuote="I'm failed over and over and over again in my life that is why I succeed!";
System.out.println( mjQuote.substring( mjQuote.length()-8, mjQuote.length()-1));
package numbers;
public class Sixth {
public static void main(String[] args) {
String mjQuote="I'm failed over and over and over again in my life that is why I succeed!";
System.out.println(mjQuote.substring(mjQuote.indexOf("again"),mjQuote.indexOf("again")+"again".length()));
package numbers;
public class Seventh {
public static void main(String[] args) {
String name="Let us always meet each other with smile, for the smile beginning of love.";
System.out.println(name.replace("smile",":)"));
package homeWork1;
public class DHMS {
public static void main(String[] args) {
long days =System.currentTimeMillis()/1000/60/60/24,
hours =System.currentTimeMillis()/1000/60/60%24,
minutes =System.currentTimeMillis()/1000/60%60,
package homeWork1;
public class Namber {
public static void main(String[] args) {
double value=-7643546.0000004;
String strValue=String.valueOf(value);
long a=Long.valueOf(strValue.substring(0, strValue.indexOf(".")));
long b=Long.valueOf(strValue.substring(strValue.indexOf(".")+1));
package homeWork1;
public class ChangeTheWolrd {
public static void main(String[] args) {
String s="Education is the most powerful weapon which you can use to change the world.";
String t="An investment in knowledge pays the best interest.";
System.out.print("\""+s.substring(s.indexOf("use"),s.indexOf("use")+"use".length())+" "+